Giter Site home page Giter Site logo

klog.net's People

Contributors

joshkeegan avatar

Watchers

 avatar  avatar  avatar

klog.net's Issues

FileLog blocks calling thread

FileLog will perform the write on the thread that calls the Log write.
This could create unwanted performance problems in an application

ColouredConsoleLog colours & threads problem

The ColouredConsoleLog doesn't lock access to the console, so if there are several threads all writing to the Console at once with different log levels a message may appear half in one colour and half in another.

Could be solved with locking, but this would block the calling threads.
Could also solve with a separate thread responsible for writing things to the console log, similar to the plan for file logs.

TaskCanceledException

  1. Test Error : UnitTests.LogConcurrencyWrapperTests.TestUnderlyingLogDisposal
    System.AggregateException : One or more errors occurred.
    ----> System.Threading.Tasks.TaskCanceledException : A task was canceled.
    at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
    at KLog.LogConcurrencyWrapper1.BlockWhileWriting() in c:\projects\klog-net\KLog\KLog\LogConcurrencyWrapper.cs:line 106 at KLog.LogConcurrencyWrapper1.Dispose(Boolean disposing) in c:\projects\klog-net\KLog\KLog\LogConcurrencyWrapper.cs:line 130
    at UnitTests.LogConcurrencyWrapperTests.TestUnderlyingLogDisposal() in c:\projects\klog-net\KLog\UnitTests\LogConcurrencyWrapperTests.cs:line 26
    --TaskCanceledException

Full build output at: https://ci.appveyor.com/project/JoshKeegan/klog-net/build/0.1.65

Looks like the task is being canceled before its actually finished starting up (entered the Running state).

CompoundLog performance

CompoundLog sets its LogLevel to LogLevel.All.
This means that Log.mayWriteLevel will always get passed LogLevel.All, so CompoundLog.write will always get called. This might not seem like a massive performance hit, but before writing to the CompoundLog, Log.tryWriteLevel will use getCallingFrame() which isn't very perforance friendly (see #10).

If I've thought this through properly, that means that in production applications (some of which are performance sensitive), we'll still be creating a StackTrace object for every Log.Debug call, even though the log level won't include debug.

Need to set up a perf test for this, but if it is causing problems should change it to calculate the maximum log level of all child logs and use that as the CompoundLog log level.

DB Logging can kill entire application if throws

Assume will be the same for all log types, but has happened with DB.
When DB server is busy, unavailable or whatever and the transaction fails, will throw. Exception goes uncaught and propagates all the way up to the application, killing it.

LogRateLimiter Tests slow

LogRateLimiter tests have been slowed down for Appveyor.
The time it waits is set in a constants at the top of LogRateLimiterTests.cs.
Make a PS script to perform the compilation rather than relying on the default appveyor stuff. This will let us pass a custom /define to the compiler, so the wait time can be set at compile time based on whether "appveyor" is defined.
Will still be slow on appveyor but will be quick elsewhere.

Travis unit tests not working

On travis, the build is now working with the new Release-mono-compat configuration, but looking at the log, the unit tests fail.

Need to check if they run under mono usually.

Email IOException

Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.IOException
Stack:
at System.Net.Sockets.NetworkStream.Read(Byte[], Int32, Int32)
at System.Net.PooledStream.Read(Byte[], Int32, Int32)
at System.Net.Mail.SmtpPooledStream.Dispose(Boolean)
at System.IO.Stream.Close()
at System.Net.ConnectionPool.Destroy(System.Net.PooledStream)
at System.Net.ConnectionPool.ForceCleanup()
at System.Net.ConnectionPoolManager.CleanupConnectionPool(System.Net.ServicePoint, System.String)
at System.Net.Mail.SmtpClient.Dispose(Boolean)
at KLog.EmailLog+<>c__DisplayClass1.b__0(System.Object, System.ComponentModel.AsyncCompletedEventArgs)

Optimise Log.getCallingFrame()

Log.getCallingFrame() makes a new StackTrace object which uses a lot of CPU (see screenshot)
klog optimisation stacktrace

Need to look into how that works, but I'm guessing the ctor gets the full StackTrace (all frames), when we only want the top one (that's meets our criteria).
If that's the case, this could be a major optimisation.

NUnit 3

Upgrade unit tests to NUnit 3

LogFilter

A wrapper for a Log that can be used to filter out log messages.

Simple implementation would be to just have it take a delegate that takes a LogEntry and returns a bool, which is whether to actually write that LogEntry.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.