Comments (9)
Design is that. It may be lost some log when set logger filter level. but. I can & will change the design resolve this problem.
from log4z.
I already fix the first problem at the master.
from log4z.
first. setLoggerLevel is one immediately sync call, but write log is async call. so it's will lose some log when switch filter level( specific level go up). like this code.
ILog4zManager::getRef().setLoggerLevel(LOG4Z_MAIN_LOGGER_ID, LOG_LEVEL_TRACE);
LOGT("set LOG_LEVEL_TRACE ----------------------------");
ILog4zManager::getRef().setLoggerLevel(LOG4Z_MAIN_LOGGER_ID, LOG_LEVEL_DEBUG);
LOGT("set LOG_LEVEL_TRACE ============================");
it's all log lose at the old log4z version.
current version only lose the second log. it's expect.
at current version. the setLoggerLevel call is immediately and sync when the level go down, and it's will be async when level go up.
from log4z.
mm. somewhat complex..
may be its better to filter out messages in queue processing procedure and add to queue all messages? in this case with sync setLevel (and other behavior-modifing functions) no messages will be lost?
of course it'll impact performance. in some usecases noticeably. but in other cases - like mine - degraded performance is better than losing messages
moreover, splitting one queue to multiple, one per logger, will allow any dynamic in-sync tuning for loggers and may be even get rid of most hateful comment //! Needs to be called before ILog4zManager::Start, OR Do not call.
from log4z.
after some thinking, about queue and level..
to have true full in-sync control on loggers behavior and messages control instructions should be also queued mixed with log messages
mm. i think its beyond this ticket/issue
from log4z.
swich level, itself is filter/discard some log. so i think the "set filter level" operator can tolerate lose some log, now log4z will as more as possible to keep the more log when switch level, I think it's enough, you can assume the operation can't lose any log now.
from log4z.
I thinked your suggest. the performence is 'queue i/o' > 'log create/destroy' > 'disk io'. so the multi -queue suggest is not important. and the log create/destroy is better important because it's new one fixed big memory each pushlog.
in my project have a lot of trace log, at most of the time it's all filter. if used all message input queue mod, it's not little degraded performence. so although this suggest is simple, i select other.
from log4z.
at first of this project. I have no think about the sync write log, it's apend to project latter. so it's not perfect, only have the features.
I will think about and complete it later.
thanks your suggest.
from log4z.
the sync problem may be can use diff log pre-name to solve. it's support hot-update, but have little ugly.
from log4z.
Related Issues (20)
- 建议封装成动态库 HOT 2
- 怎么输出进程线程ID啊?还有就是输出的顺序有点问题? HOT 1
- 进程长时间不写(跨天),重新新建log文件写入的问题 HOT 1
- 是否支持中文路径? HOT 1
- android compile err.error: 'gcvt' was not declared in this scope. HOT 3
- Thread_local is not supported for iOS 8.4 or earlier. It will cause a compile error in Xcode HOT 1
- 'isnan' was not declared in this scope if (isnan(t)) ;这样的问题怎么解决? HOT 1
- DynamicCreateLogger 接口缺失 HOT 2
- 在VS下断点调试时,并不能立即输出 HOT 2
- API reference is missed HOT 2
- 如何限制日志的大小呢? HOT 1
- error C3861: 'isnan': identifier not found HOT 1
- 日志自动清除 HOT 2
- 可以指定文件名格式和文件夹格式吗
- Log4zFileHandler::open不支持单个2GB以上的文件
- Mismatch (malloc vs operator delete)
- 这个是不是多线写日志文件 自旋锁导致的问题 程序崩溃?
- log4z thread mutex bug? HOT 1
- 请问单条日志容量如何设定?
- Does log4z clear old logs in the logfolder? 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 log4z.