[#BloombergLP-ball-LoggerManager-setCategory-03]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/ball.adoc[ball]::xref:BloombergLP/ball/LoggerManager.adoc[LoggerManager]::setCategory
:relfileprefix: ../../../
:mrdocs:

Return or create the category and optionally link a holder&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/ball/Category.adoc[Category] const*
setCategory(
    xref:BloombergLP/ball/CategoryHolder.adoc[CategoryHolder]* categoryHolder,
    char const* categoryName);
----

== Description

Add to the category registry of this logger manager a new category having the specified `categoryName` and default threshold levels if `categoryName` is not present in the registry and the number of categories in the registry is less than the registry capacity&period; Return the address of the (possibly newly&hyphen;created) non&hyphen;modifiable category having `categoryName`, if such a category exists, and the address of the non&hyphen;modifiable _Default_ _Category_ otherwise&period; If the specified `categoryHolder` is non&hyphen;null, then also load into `categoryHolder` the returned category and its maximum level and link `categoryHolder` to the category if it has not yet been linked&period; The behavior is undefined unless `categoryName` is null&hyphen;terminated&period; Note that a valid category address is _always_ returned&period;

== Return Value

address of the category named `categoryName`, or of the _Default_ _Category_

== Parameters

[cols="1,4"]
|===
| Name| Description
| *categoryHolder*
| optional holder to link to the returned category
| *categoryName*
| name of the category to return or create
|===


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