|
BDE 4.14.0 Production release
|
Provide a container for a name and associated thresholds.
This component primarily provides a class, ball::Category, used to describe the properties of a logging category. A ball::Category provides access to the category name and the 4 logging threshold levels associated with a category (see ball_loggermanager for a description of the purpose of the various thresholds).
This component provides classes that are not intended for use by the users of the ball logging sub-system: ball::CategoryHolder and ball::CategoryManagerImpUtil. These classes are defined in this component because they are either friends of ball::Category or have a circular definition with ball::Category. They are used within the logging sub-system to efficiently process log records.
A ball::CategoryHolder is a statically-initializable pointer to a log category. It is designed to work with the logging macros provided by ball (see {ball_log}), and provide a static cache of the log category at the point where a log macro is invoked.
A ball::CategoryManagerImpUtil provides a suite of utility functions used in creating a manager for log categories (see ball_categorymanager ). A ball::Category object maintains private state that is accessed and manipulated via this utility. Each ball::Category contains private data members that provide:
ball::CategoryHolder objects that refer to the category.ball::AttributeContext must be performed).This section illustrates intended use of this component.
The following example demonstrates creating a category and accessing its threshold information.
Note that other components in the logging subsystem provide more user focused examples of using categories (see ball_loggermanager , ball_administration , and ball_categorymanager ).
First we create a simple category, example, that has the record-level, trigger-level, and trigger-all thresholds set to OFF and the pass-level set to WARN, and verify these values:
See ball_loggermanager for more information on the use of various thresholds levels.
Finally, we test if a the category is enabled for log record recorded with e_ERROR severity: