[#BloombergLP-ball-LoggerCategoryUtil]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/ball.adoc[ball]::LoggerCategoryUtil
:relfileprefix: ../../
:mrdocs:

This struct provides a suite of utility functions that facilitate the management of the categories in `LoggerManager`&period;

== Synopsis

Declared in `&lt;ball&lowbar;loggercategoryutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct LoggerCategoryUtil;
----

== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/ball/LoggerCategoryUtil/addCategoryHierarchically.adoc[`addCategoryHierarchically`] 
| Add, to the specified `loggerManager`, a new category having the specified `categoryName`&semi; return the address of the modifiable new category on success, and 0, with no effect, if a category by that name already exists or if the number of existing categories has reached the maximum capacity&period; The newly created category will have its threshold levels chosen primarily from two sources&colon; threshold levels of an existing category or a category setting (to which no category exists) choosing the one whose name is the longest non&hyphen;empty prefix of `categoryName`&period; If such a category or setting exists, and the default threshold levels (which might be overridden by a default threshold levels callback) otherwise&period; See also `ball&colon;&colon;CategoryManager&colon;&colon;addCategoryHierarchically`&period;
| xref:BloombergLP/ball/LoggerCategoryUtil/setThresholdLevels.adoc[`setThresholdLevels`] 
| Same as `setThresholdLevelsHierarchically` except that a `&ast;` located at the end of `pattern` is recognized as a special character and removed before performing the operation&period; Thus, this function sets, in the specified `loggerManager`, the threshold levels of every existing and future category whose name has, as a prefix, the substring of `pattern` excluding an optional trailing `&ast;`, to the specified threshold values, `recordLevel`, `passLevel`, `triggerLevel`, and `triggerAllLevel`&period; In case `pattern` is `&ast;` or empty, set the threshold level of every existing category, and remove all preliminary settings (for categories that do not exist yet)&period; Return the number of categories whose threshold levels were set, and a negative value, with no effect, if any of the specified threshold values is outside the range `&lsqb;0 &period;&period; 255&rsqb;`&period; The behavior is undefined unless `loggerManager` is not in the process of being destroyed&period; See also `setThresholdLevelsHierarchically` and `ball&colon;&colon;CategoryManager&colon;&colon;setThresholdLevelsHierarchically`&period;
| xref:BloombergLP/ball/LoggerCategoryUtil/setThresholdLevelsHierarchically.adoc[`setThresholdLevelsHierarchically`] 
| In case the specified `categoryNamePrefix` is not empty set, in the specified `loggerManager`, the threshold levels of every existing and future category whose name has, as a prefix, `categoryNamePrefix` to the specified threshold values, `recordLevel`, `passLevel`, `triggerLevel`, and `triggerAllLevel`&period; In case `categoryNamePrefix` is empty set the threshold level of every existing category, and remove all preliminary settings (for categories that do not exist yet)&period; Return the number of categories whose threshold levels were set, and a negative value, with no effect, if any of the specified threshold values is outside the range `&lsqb;0 &period;&period; 255&rsqb;`&period; The behavior is undefined unless `loggerManager` is not in the process of being destroyed&period; See also `ball&colon;&colon;CategoryManager&colon;&colon;setThresholdLevelsHierarchically`&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
