This class provides constrained configuration parameters for a logger manager. The constraints are maintained as class invariants; it is not possible to obtain an invalid object through this interface.

Synopsis

Declared in <ball_loggermanagerconfiguration.h>

class LoggerManagerConfiguration;

Description

This class support in‐core value‐semantic operations, including copy construction, assignment, and equality comparison; ostream printing is supported, but in a modified form to handle functors, and BDEX serialization cannot be supported at all. (A precise operational definition of when two instances have the same (in‐core) value can be found in the description of operator== for the class.) This class is exception neutral with no guarantee of rollback: If an exception is thrown during the invocation of a method on a pre‐existing instance, the object is left in a valid state, but its value is undefined. In no event is memory leaked. Finally, aliasing (e.g., using all or part of an object as both source and destination) is supported in all cases.

Type Aliases

Name

Description

CategoryNameFilterCallback

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

DefaultThresholdLevelsCallback

DefaultThresholdLevelsCallback is the type of the functor that determines default threshold levels for categories added to the registry by the setCategory(const char *) method.

UserFieldsPopulatorCallback

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

Enums

Name

Description

LogOrder

The LogOrder enumeration defines the order in which messages will be published to the underlying observer in the case of Trigger and Trigger‐All events.

TriggerMarkers

The TriggerMarkers enumeration defines whether text will be written to the log to indicate whether a series of log records were logged due to either a Trigger or Trigger‐All event. If this attribute is e_BEGIN_END_MARKERS, then "BEGIN RECORD DUMP" and "END RECORD DUMP" will be written before and after each sequence of records logged due to a Trigger or Trigger‐All event. The default value of this attribute is e_BEGIN_END_MARKERS.

Member Functions

Name

Description

LoggerManagerConfiguration [constructor]

Constructors

operator=

Assign to this logger manager configuration constrained‐attribute object the in‐core value of the specified rhs object.

categoryNameFilterCallback

Return a reference to the non‐modifiable category name filter functor attribute of this object.

defaultLoggerBufferSize

Return the default logger‐message‐buffer size attribute of the LoggerManagerDefaults attribute of this object.

defaultPassLevel

Return the default Pass threshold level attribute of the LoggerManagerDefaults attribute of this object.

defaultRecordBufferSize

Return the default‐logger record‐buffer size attribute of the LoggerManagerDefaults attribute of this object.

defaultRecordLevel

Return the default Record threshold level attribute of the LoggerManagerDefaults attribute of this object.

defaultThresholdLevelsCallback

Return a reference to the non‐modifiable default severity‐level thresholds functor attribute of this object.

defaultTriggerAllLevel

Return the default Trigger‐All threshold level attribute of the LoggerManagerDefaults attribute of this object.

defaultTriggerLevel

Return the default Trigger threshold level attribute of the LoggerManagerDefaults attribute of this object.

defaults

Return a reference to the non‐modifiable defaults object attribute of this object.

logOrder

Return the log order attribute of this object. See attributes description for effects of the log order.

print

Format a reasonable representation of this object to the specified output stream at the (absolute value of) the optionally specified indentation level and return a reference to stream. If level is specified, optionally specify spacesPerLevel, the number of spaces per indentation level for this and all of its nested objects. If level is negative, suppress indentation of the first line. If spacesPerLevel is negative, suppress all indentation AND format the entire output on one line. If stream is not valid on entry, this operation has no effect. The format will indicate whether the contained functors are or are not "null", but will not otherwise attempt to represent functor "values".

setCategoryNameFilterCallback

Set the category name‐filter callback functor attribute of this object to the specified nameFilter. Note that this method cannot fail, and that nameFilter can be a "null" (i.e., unpopulated) functor object.

setDefaultLoggerBufferSizeIfValid

Set the default logger‐message‐buffer size attribute of the LoggerManagerDefaults attribute of this object to the specified numBytes if 0 < numBytes. Return 0 on success, and a non‐zero value otherwise with no effect on this object.

setDefaultRecordBufferSizeIfValid

Set the default‐logger record‐buffer size attribute of the LoggerManagerDefaults attribute of this object to the specified numBytes if 0 < numBytes. Return 0 on success, and a non‐zero value otherwise with no effect on this object.

setDefaultThresholdLevelsCallback

Set the default thresholds callback functor attribute of this object to the specified thresholdsCb. Note that this method cannot fail, and that thresholdsCb can be a "null" (i.e., unpopulated) functor object.

setDefaultThresholdLevelsIfValid

setDefaultThresholdLevelsIfValid overloads

setDefaultValues

Set the default values attribute of this object to the specified defaults. Note that, since defaults is itself a constrained‐attribute object, this method cannot fail.

setLogOrder

Set the log order attribute of this object to the specified value.

setTriggerMarkers

Set the trigger marker attribute of this object to the specified value.

setUserFieldsPopulatorCallback

Set the user‐fields populator callback attribute of this object to the specified populatorCallback.

triggerMarkers

Return the trigger marker attribute of this object. See attributes description for effects of the trigger markers.

userFieldsPopulatorCallback

Return a reference providing non‐modifiable access to the user‐fields populator functor attribute of this object.

operator BloombergLP::bslmf::NestedTraitDeclaration<LoggerManagerConfiguration, UsesBslmaAllocator>

Nested trait declaration for bslma::UsesBslmaAllocator.

Static Member Functions

Name

Description

areValidDefaultThresholdLevels

Return true if each of the specified recordLevel, passLevel, triggerLevel, and triggerAllLevel values is a valid default severity threshold level, and false otherwise. Valid severity threshold levels are in the range [0 .. 255].

isValidDefaultLoggerBufferSize

Return true if the specified numBytes is a valid default logger‐message‐buffer size value, and false otherwise. numBytes is valid if 0 < numBytes.

isValidDefaultRecordBufferSize

Return true if the specified numBytes is a valid default‐logger record‐buffer size value, and false otherwise. numBytes is valid if 0 < numBytes.

Friends

Name

Description

BloombergLP::ball::operator==

Return true if the specified lhs and rhs attribute objects have the same (in‐core) value, and false otherwise. Two attribute objects objects have the same in‐core value if each respective attribute has the same in‐core value. Note that functor attributes must have identically the same representation to have the same in‐core value.

BloombergLP::ball::operator<<

Write a reasonable representation of the specified configuration object to the specified output stream, indicating whether the contained functors are or are not "null".

Non-Member Functions

Name

Description

operator!=

Return true if the specified lhs and rhs attribute objects do not have the same (in‐core) value, and false otherwise. Two attribute objects do not have the same in‐core value if one or more respective attributes differ in in‐core values. Note that functor attributes will have different in‐core values if their representations are not identical.

Created with MrDocs