You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Combined logger concept.
Now all loggers - are just sets of features combined in a single logger object. When specializing combined logger, you should specify additional parameters, by which filtering should occur when opening a record and before they will be merged with internal attributes set. For example you may specify no additional parameters and you get the simplest logger case. Another case - when you want to perform early filtering by verbosity level you can just specify its type with combination of base logger and the filtering function will require that level type.
Filtering policies, which provide almost costless filtering.
A composite logger accepts additional policy parameter instead of mixed type and its argument pack. All methods, that opens a record now accepts variadic pack which is forwarded to that policy.
Additional attributes insertion into an internal set can be implemented using population trait, which is provided as first template parameter in a filtering policy.
Threading policy support for logger.
A composite logger can be configured with desired threading policy. That means if the logger doesn't require internal synchronization, it won't do it (if the corresponding policy is provided).
Internal attributes attachment as a feature.
Every project should define which of internal attributes (PID, TID, etc.) should be attached to every logging event.
Bug fixes
Fix string literal warnings on some ancient compilers.
Workaround GCC 4.4 pragmas.
Checking frontend set emptiness is now always under the lock.
API
It's possible to forward all required arguments to final logger's constructor, while creating it through a repository.
Logger's move constructor, move assignment operator and swap function no longer contain noexcept specifications, because given methods actually can throw.
This is a breaking change.
Disabled tracking feature, because it shouldn't be in a logger itself, but somewhere else.
This is a breaking change.
Verbose logger concept review.
No longer possible to open verbose logger's record without specifying severity level. This is required due to fact, that there is a primary filtering now, which strongly required severity level provided. Moreover there can be user specific filtering function that be cannot ignore.
Proper verbose logger initialization with a given severity level.
No longer possible to initialize verbose logger with garbage level value, because user specific severity enumeration may start with any value.
Instead of this, the User if forced to provide severity threshold explicitly. Verbosity threshold should always be specified, when setting verbosity to a logger, even with filtering function.
This is a breaking change.
Drop global logger attribute set.
After half year of user experience I've realized that nobody uses logging-attached attributes. The main reason of it - because of Wrappers. You can create logger wrapper, attach some attributes and work with it without copying underlying logger resources like file descriptors or sockets.
As a result - you can have only one logger for application, but with multiple wrappers. This is a big advantage, but this is a breaking change.
Dropped logger concept classes, because it was inconvenient and buggy.
This is a breaking change.
Redesign invalid record concept.
When opening a record there is a non-zero chance, that you will receive an empty record with no attributes attached. Previously it was considered as invalid record, because there was at least pid and tid attributes attached. But now seems to be there is no need to attach internal attributes before filtering. However now it is considered as valid, just without attributes.
This is a breaking change.
Filtering function parameters review.
Logging filtering function now accepts lightweight combined attribute set view. Technically it allows to perform faster filtering, because there is no need to construct combined set - it will be constructed only if the filtering succeed.
This is a breaking change.
Deprecated file blackhole/log.hpp file is no longer part of public API, just as planned.
This is a breaking change.
Other
Internal and external attribute sets initial capacity can be configured using macro variables.
Clang support on non OS X targets.
Documentation has been slightly changed and restyled.
Code coverage analyze using lcov util.
No more words, just type make coverage and you will see.
No longer fetch gtest/gmock as submodules.
Now these helpful frameworks are obtained via cmake download feature.
No longer fetch benchmarking framework as submodule. Instead of that, cmake download feature is used.
Performance
Changed attribute set underlying representation.
Now attribute set is internally represented as vector of pairs. This change allows to keep attributes in single memory block, which is good for caching and performance.
On the other hand attribute lookup time by user attributes may increase, because they are scanned using linear search. Also I don't see any need for handling duplicates, so now there can be duplicates (which actually can be eaten if needed).
There are two attributes sets in every record: internal and external. Internal attributes is setting by logger itself: message, severity, timestamp, pid, tid or lwp. All attributes that is configured via scoped sets or wrappers - are external. This distribution allows me in the future to map each internal attribute with its unique number to perform even more faster table lookup. This change increases performance of almost every case by approximately 20-30%.
Got rid of several unnecessary file includes, which saves some compile time.
Avoid unnecessary string copying or moving when comparing attributes.
Explicitly move the value when opening a record with a single attribute.
Testing
Added multithreaded scalability benchmarks.
Added huge number of benchmarks (approximately 300), that test every possible combination of cases.
These are generated using preprocessor magic.
Fixed possible conditional jump.
To check results from functions, which can go the wrong way - is a good idea! Sometimes strftime cannot fill provided buffer completely, because of initial format, for example.
The best way for testing environment is to abort program execution and extend the buffer needed to match all cases.
Fixed comparing signed with signed and vise versa.