Comments (7)
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.
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.
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.
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.
I've released 1.4.0
, it includes ZLoggerOptions.FlushRate
.
from zlogger.
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.
Timestamp is created at Log method called.
frameNumber and GetLongTime are not concerned with this lib.
from zlogger.
Related Issues (20)
- v2 release task
- Misuse HOT 5
- Improvement: Shared Files HOT 2
- Improvement: Add optional MessageCap HOT 2
- Make use of "Interceptors" feature from C# 12 (Experimental) HOT 3
- Possible symbol name collisions in generated code HOT 2
- Recommendation for Caller* attributes HOT 3
- Add Intermediate String Interpolater HOT 3
- Add native CLEF format json logging support HOT 7
- UnitLoggerFactory formatting problems with JSON messages HOT 4
- NuGet Clone failure in Unity With dotnet 4.8.1 HOT 5
- Dependency errors in Unity 2023.2 HOT 7
- Some AOT warning HOT 2
- MessageSequence's IEnumerable Handling Assumptions lead to erroneous serialization HOT 13
- NullReferenceException due to Key being Null in MagicalBox.ReaderCache HOT 9
- How to use customize structured logging HOT 1
- Load Assembly faild in unity 2021.3.12(MacOs)/15(Win11) HOT 4
- FileLogger not Compatible with WebGL HOT 1
- Typo in the "about" text to the repository HOT 1
- IL2CPP build problem with UnityLoggerFactory HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zlogger.