Home » Community » U++ community news and announcements » U++ logging refactored
U++ logging refactored [message #36754] |
Mon, 02 July 2012 17:34 |
|
mirek
Messages: 13980 Registered: November 2005
|
Ultimate Member |
|
|
While finishing Skylark, I have found certain features of U++ logging inadequate.
First of all, output from multiple threads depended on locks in LOGing macros, which was fine for macros, but e.g. Sql is not using these macros (and thus MT logging was basically broken in Sql). Fixed by complete refactoring of LogStream, which is now handling locking internally (serializes issuing completed lines to the output).
The I have removed secondary logs UsrLog and BugLog and integrated them to the main log output.
I have added new standard log options:
LOG_SYS - in Posix, log is outputed to syslog too.
LOG_ROTATE(n) - when .log file is about to be replaced, up to 'n' older logs are preserved (using file extensions '.1', '.2', ... '.n').
LOG_ROTATE_GZIP - preserved logs '.2' and higher are gzipped.
I have also introduced a new concept, 'modular' logging, which usually should be bound to program config (e.g. .ini file) and immediately used it to replace UsrLog concept (two lines of code better than 300 words :):
#define LOG_(flag, x) do { if(flag) RLOG(x); } while(false)
namespace Ini {
extern Bool user_log;
};
#define USRLOG(x) LOG_(Ini::user_log, x)
Last but not least, logging is now documented
UPDATE: Config->Ini
[Updated on: Tue, 03 July 2012 09:57] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Tue May 14 21:42:25 CEST 2024
Total time taken to generate the page: 0.02699 seconds
|