This class is usually a singleton factory for Logger objects.

Synopsis

Declared in <ball_loggermanager.h>

class LoggerManager;

Description

This class is usually a singleton. It provides a factory for Logger objects and is also a wrapper for category administration services. Note that some services provided by this class are available only after the singleton has been initialized.

Type Aliases

Name

Description

AttributeCollector

AttributeCollector is the type of a user‐supplied functor used to visit a collection of attributes.

AttributeVisitor

AttributeVisitor is the type of a user‐supplied functor invoked by an attribute collector for every attribute.

CategoryNameFilterCallback

CategoryNameFilterCallback is the type of the user‐supplied functor that translates external category names to internal names.

DefaultThresholdLevelsCallback

Functor that determines default threshold levels for new categories.

ObserverRegistry

This typedef is an alias for the type of the internal broadcast observer registry.

PublishAllTriggerCallback

Functor invoked to publish all active loggers' record buffers.

UserFieldsPopulatorCallback

UserFieldsPopulatorCallback is the type of a user‐supplied callback functor used to populate the user‐defined fields in each log record.

Member Functions

Name

Description

LoggerManager [constructor]

Create a logger manager with the specified configuration.

~LoggerManager [destructor]

Destroy this logger manager.

addCategory

Add a category with the specified name and threshold levels.

addCategoryHierarchically

Add a new category, inheriting thresholds hierarchically.

addRule

Add a rule having the specified value.

addRules

Add each rule in the specified ruleSet.

allocateLogger

allocateLogger overloads

allocator

Return the address of the modifiable allocator held by this logger manager.

deallocateLogger

Deallocate the specified logger and release it from management.

defaultCategory

defaultCategory overloads

defaultPassThresholdLevel

Return the default pass threshold level of this logger manager.

defaultRecordThresholdLevel

Return the default record threshold level of this logger manager.

defaultThresholdLevels

Return the default threshold levels associated with this logger manager object.

defaultTriggerAllThresholdLevel

Return the default trigger‐all threshold level of this logger manager.

defaultTriggerThresholdLevel

Return the default trigger threshold level of this logger manager.

deregisterAllObservers

Remove all observers from the registry of observers maintained by this logger manager.

deregisterAttributeCollector

Remove the named attribute collector from the registry.

deregisterObserver

Remove the named observer from the registry.

findObserver

findObserver overloads

getLogger

Return a non‐`const` reference to a logger managed by this logger manager suitable for performing logging operations for this thread of execution.

isCategoryEnabled

Return whether logging at the specified severity is enabled.

lookupCategory

lookupCategory overloads

maxNumCategories

Return the current capacity of the category registry.

numCategories

Return the number of categories in the category registry of this logger manager.

observer

observer overloads

publishAll

Publish all buffered records from all managed loggers.

registerAttributeCollector

Register the specified collector under collectorName.

registerObserver

Register the specified observer under observerName.

removeAllRules

Remove every rule from the set of rules maintained by this object.

removeRule

Remove the rule having the specified value.

removeRules

Remove each rule in the specified ruleSet.

resetDefaultThresholdLevels

Reset the default threshold levels of this logger manager to the original "factory‐supplied" default values or the factory overrides supplied at construction.

ruleSet

Return a const reference to the rule set maintained by this object.

setCategory

setCategory overloads

setCategoryThresholdsToCurrentDefaults

Set category thresholds to the current default values.

setCategoryThresholdsToFactoryDefaults

Set category thresholds to the factory default values.

setDefaultThresholdLevels

Set the default threshold levels.

setDefaultThresholdLevelsCallback

Set the default‐thresholds callback.

setLogger

Set this thread's default logger to the specified logger.

setMaxNumCategories

Set the category registry capacity.

setThresholdLevelsHierarchically

Set thresholds for categories matching categoryNamePrefix.

thresholdLevelsForNewCategory

Load the threshold levels that would apply to a new category.

userFieldsPopulatorCallback

Return the address of the non‐modifiable user populator functor registered with this logger manager, or 0 if there is no registered user populator functor.

visitCategories

visitCategories overloads

visitObservers

Visit each registered observer with the specified visitor.

Static Member Functions

Name

Description

createLoggerManager

createLoggerManager overloads

getRecord

Return a modifiable record allocated from the default allocator.

initSingleton

initSingleton overloads

isInitialized

Return true if the logger manager singleton exists, and false otherwise.

logMessage

Publish and dispose of a record via the platform default handler.

obtainMessageBuffer

obtainMessageBuffer overloads

shutDownSingleton

Destroy the logger manager singleton and release its resources.

singleton

Return a non‐`const` reference to the logger manager singleton. The behavior is undefined unless the logger manager singleton exists.

Friends

Name

Description

BloombergLP::ball::LoggerManagerCategoryManip

Iterator providing modifiable access to logger manager categories.

BloombergLP::ball::LoggerManagerCategoryIter

Iterator providing read‐only access to logger manager categories.

Created with MrDocs