Blackhole v0.4.0 Release Notes

Release Date: 2015-01-13 // over 9 years ago
  • โž• Added

    • 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 ([#20]).

    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.

    • ๐Ÿ‘ Clang support on non OS X targets.
    • ๐Ÿ‘€ Code coverage analyze using lcov util. No more words, just type make coverage and you will see ([#38]).
    • Multithreaded scalability benchmarks ([#36]).
    • โœ… Huge number of benchmarks (approximately 300), that test every possible combination of cases. These are generated using preprocessor magic.

    ๐Ÿ”„ Changed

    • ๐Ÿ”„ Changed attribute set underlying representation ([#18]).

    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%.

    • 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 change breaks API.
    • Disabled tracking feature, because it shouldn't be in a logger itself, but somewhere else. This change breaks API.
    • 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 change breaks API.

    • 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 change breaks API.

    • Filtering function parameters review ([#33]).

    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 change breaks API.

    • Deprecated file blackhole/log.hpp file is no longer part of public API, just as planned. This change breaks API.
    • ๐Ÿ”ง Internal and external attribute sets initial capacity can be configured using macro variables.
    • ๐Ÿ“š Documentation has been slightly changed and restyled.
    • โœ… 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.
    • 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.

    โœ‚ Removed

    • โฌ‡๏ธ 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.

    ๐Ÿ›  Fixed

    • ๐Ÿ›  Fix string literal warnings on some ancient compilers.
    • โ†ช Workaround GCC 4.4 pragmas.
    • ๐Ÿ”’ Checking frontend set emptiness is now always under the lock.
    • ๐Ÿ›  Fix possible conditional jump in tests.

    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.

    • ๐Ÿ›  Fix conditional jump in sticky stream ([#32]).
    • ๐Ÿ›  Fix comparing signed with signed and vise versa.
    • ๐Ÿ›  Fix broken resolver test.