Giter Club home page Giter Club logo

Comments (7)

neuecc avatar neuecc commented on September 14, 2024

ZLogger tries to write as quickly as possible.
That is, it flushes when the message buffer is empty.
I need to add the FlushRate setting.

from zlogger.

carrotstien avatar carrotstien commented on September 14, 2024

As i'm using this for a vr application, i'm worried that writing so often to the disk (and i'm hoping on a side thread...but can't find where), might result in some frame skipping.

In my own logging implementation that I replaced with Zlogger, I wrote to a fileWriter with autoflush=0ff, and then had a side thread call flush() at some interval (i think once ever 10 seconds)

from zlogger.

neuecc avatar neuecc commented on September 14, 2024

reader is already in async reader-loop. https://github.com/Cysharp/ZLogger/blob/master/src/ZLogger/AsyncStreamLineMessageWriter.cs#L89
It is run on thread-pool so does not block in logger.

from zlogger.

carrotstien avatar carrotstien commented on September 14, 2024

yea i meant more general system wide hiccup on IO. Even my powerful computer can hang for a moment when doing a heavy IO process.

Either way, i'll look forward to the FlushRate. No rush at all (in fact let me know where to donate :D ), but any estimate as to when you'll add that?

from zlogger.

neuecc avatar neuecc commented on September 14, 2024

I've released 1.4.0, it includes ZLoggerOptions.FlushRate.

from zlogger.

carrotstien avatar carrotstien commented on September 14, 2024

This flush rate works mostly as expected - in that it writes to the files after the timespan.
However, the log header defined only gets resolved at flush time. I was hoping the write would immediately to a buffer in memory, and that would get dumped to the system disk in flush time.

for example:
builder.AddZLoggerFile(filename, "file-plain" , x => { x.PrefixFormatter = (writer, info) => ZString.Utf8Format(writer, "[{0} {1} {2}]", info.Timestamp.ToLocalTime().DateTime,MainThreadActionQueue.frameNumber, Misc.GetLongTime()); x.FlushRate = TenSeconds; });

            the frame number and time stamp are resolved at flush which make them a lot less useful for debugging :(

from zlogger.

neuecc avatar neuecc commented on September 14, 2024

Timestamp is created at Log method called.

var info = new LogInfo(categoryName, DateTimeOffset.UtcNow, logLevel, eventId, exception);

frameNumber and GetLongTime are not concerned with this lib.

from zlogger.

Related Issues (20)

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.