|
6 months ago | |
---|---|---|
html | 6 months ago | |
src | 6 months ago | |
.gitignore | 1 year ago | |
COPYING | 5 years ago | |
README.md | 6 months ago |
The p≡p Logger is a fork of the Logger module of the p≡p JSON Server Adapter.
compile-time configurable via logger_config.hh
, run-time configuable via
API functions
supports logging to syslog (UN*X only), to a file and to the console (stderr).
supports log levels ("severities" in syslog terminology) and run-time filtering of log entries lower than given "log level"
API for both printf()-like ("C") style and C++ outputstream-like style
compile-time disabling of debug messages via -D DEBUG_ENABLED
(if done via macros, see below)
hierarchical Logger instances that inherit their "name" and their log level from their parent Logger instance
multi-line log messages, visualized via big square brackets
auto wrapping of long log lines, visualized via "↩" and "↪"
(configurable at run-time via Logger::setMaxLineLength()
)
log GMT / UTC timestamp and easily greppable thread IDs.
The thread IDh have the form ¶XYZ
where 'XYZ' is a hash of std::this_thread::get_id()
,
truncated to three base-37 digits, to make collisions of thread IDs unlikely.
logfile analyzer (e.g. for filtering log of different threads) via HTML & Javascript,
see html/logview.html
truncating of pathologically long log messages, visualized via "▒ (%u octets clipped)"
(configurable at run-time via Logger::setMaxMessageLength()
)
escaping of non-printing control characters, illegal Unicode codepoints and illegal UTF-8 sequences
It is so simple. This should do out of the box:
make test
TODO.
See examples in src/unittest_logger.cc