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

Add a new category with the specified name and threshold levels&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
addCategory(
    char const* categoryName,
    int recordLevel,
    int passLevel,
    int triggerLevel,
    int triggerAllLevel);
----

== Description

Add to the registry of the logger manager singleton a new category having the specified `categoryName` and the specified `recordLevel`, `passLevel`, `triggerLevel`, and `triggerAllLevel` threshold levels, respectively, if (1) `categoryName` is not present in the category registry, (2) the number of categories in the registry is less than the registry capacity, and (3) each of the level values is in the range `&lsqb;0 &period;&period; 255&rsqb;`&period; Return 0 on success, and a non&hyphen;zero value otherwise&period; The behavior is undefined unless the logger manager singleton has been initialized and is not in the process of being shut down&period;

== Return Value

0 on success, and a non&hyphen;zero value otherwise

== Parameters

[cols="1,4"]
|===
| Name| Description
| *categoryName*
| name of the category to add
| *recordLevel*
| record threshold level for the new category
| *passLevel*
| pass threshold level for the new category
| *triggerLevel*
| trigger threshold level for the new category
| *triggerAllLevel*
| trigger&hyphen;all threshold level for the new category
|===


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