BDE 4.39.x Production Release
Loading...
Searching...
No Matches
ball_hierarchicalcategorysetting

Detailed Description

Provide a container for a name prefix and associated thresholds.

Outline

Purpose

Provide a container for a name prefix and associated thresholds.

Classes

See also
ball_categorymanager

Description

This component provides the class ball::HierarchicalCategorySetting that represents the properties of a hierarchical logging category setting with a category name prefix and the 4 threshold levels. See ball_loggermanager for a description of the purpose of the various thresholds.

Usage

This section illustrates intended use of this component.

Example 1: Basic Use of ball::HierarchicalCategorySetting

The following example demonstrates how to create and use a ball::HierarchicalCategorySetting object to configure logging thresholds for categories with a specific name prefix.

First, we create a hierarchical category setting for all categories starting with "EQUITY":

"EQUITY",
192, // recordLevel
128, // passLevel
96, // triggerLevel
64); // triggerAllLevel
Definition ball_hierarchicalcategorysetting.h:126

Then, we can query the category prefix and threshold levels:

assert(setting.categoryPrefix() == "EQUITY");
assert(setting.recordLevel() == 192);
assert(setting.passLevel() == 128);
assert(setting.triggerLevel() == 96);
assert(setting.triggerAllLevel() == 64);

Finally, we can modify the threshold levels:

int rc = setting.setLevels(160, 96, 64, 32);
assert(0 == rc);
assert(setting.recordLevel() == 160);