BloombergLP::ball::LoggerManagerScopedGuard::LoggerManagerScopedGuard

Create a guard that initializes the logger manager singleton.

Synopsis

Declared in <ball_loggermanager.h>

LoggerManagerScopedGuard(
    Observer* observer,
    LoggerManagerConfiguration const& configuration,
    bslma::Allocator* globalAllocator = 0);

Description

Create a scoped guard that will create the logger manager singleton having the specified observer that receives published log records and the specified configuration of defaults and attributes. Optionally specify a globalAllocator used to supply memory. If globalAllocator is 0, the currently installed global allocator is used. This method has no effect (aside from logging a warning) if the logger manager singleton already exists. The behavior is undefined if observer is 0, goes out of scope, or is otherwise destroyed. Note that on destruction, this scoped guard will destroy the logger manager singleton, if the singleton exists at that time.

DEPRECATED: Use the LoggerManagerScopedGuard constructor that does not take a raw pointer to an observer, together with the registerObserver method (which takes a shared pointer to an observer), instead.

Parameters

NameDescription
observerobserver that receives published log records
configurationdefaults and attributes for the singleton
globalAllocatormemory allocator; null uses the global