[#BloombergLP-ball-LoggerManager-initSingleton-01]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/ball.adoc[ball]::xref:BloombergLP/ball/LoggerManager.adoc[LoggerManager]::initSingleton
:relfileprefix: ../../../
:mrdocs:

`initSingleton` overloads

== Synopses

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

Initialize the logger manager singleton&period; Optionally specify a `configuration` describing how the singleton should be configured&period; If `configuration` is not specified, a default constructed `LoggerManagerConfiguration` object is used&period; Optionally specify a `globalAllocator` used to supply memory&period; If `globalAllocator` is 0, the currently installed global allocator is used&period; Return a non&hyphen;`const` reference to the logger manager singleton&period; This method has no effect (aside from logging a warning) if the logger manager singleton already exists&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
xref:BloombergLP/ball/LoggerManager.adoc[LoggerManager]&
xref:BloombergLP/ball/LoggerManager/initSingleton-06.adoc[initSingleton](xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* globalAllocator = 0);
----

[.small]#xref:BloombergLP/ball/LoggerManager/initSingleton-06.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, using the specified `configuration`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
xref:BloombergLP/ball/LoggerManager.adoc[LoggerManager]&
xref:BloombergLP/ball/LoggerManager/initSingleton-05.adoc[initSingleton](
    xref:BloombergLP/ball/LoggerManagerConfiguration.adoc[LoggerManagerConfiguration] const& configuration,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* globalAllocator = 0);
----

[.small]#xref:BloombergLP/ball/LoggerManager/initSingleton-05.adoc[_» more&period;&period;&period;_]#

Initialize the logger manager singleton with the specified `singleton`&period; Optionally specify an `adoptSingleton` flag indicating whether this method takes ownership of `singleton`, in which case `shutDownSingleton` will destroy `singleton`&period; If `adoptSingleton` is not specified, this method does _not_ take ownership of `singleton` (and `shutDownSingleton` will not destroy it)&period; Return 0 if the logger manager singleton was successfully initialized, and a non&hyphen;zero value otherwise&period; This method has no effect (aside from logging a warning) if the logger manager singleton already exists, in which case this method does _not_ take ownership of `singleton` regardless of the value of `adoptSingleton`&period; Note that this version of `initSingleton` is meant for use _only_ on Windows to initialize another dynamically loaded copy of the `LoggerManager` system&period; Also note that a suitable singleton may be obtained by calling `createLoggerManager`, or from the `singleton` class method of an already&hyphen;initialized `LoggerManager` system&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
xref:BloombergLP/ball/LoggerManager/initSingleton-0b1.adoc[initSingleton](
    xref:BloombergLP/ball/LoggerManager.adoc[LoggerManager]* singleton,
    bool adoptSingleton = false);
----

[.small]#xref:BloombergLP/ball/LoggerManager/initSingleton-0b1.adoc[_» more&period;&period;&period;_]#

Initialize the logger manager singleton having the specified `observer` that receives published log records&period; Optionally specify a `configuration` describing how the singleton should be configured&period; If `configuration` is not specified, a default constructed `LoggerManagerConfiguration` object is used&period; Optionally specify a `globalAllocator` used to supply memory&period; If `globalAllocator` is 0, the currently installed global allocator is used&period; Return a non&hyphen;`const` reference to the logger manager singleton&period; This method has no effect (aside from logging a warning) if the logger manager singleton already exists&period; The behavior is undefined if `observer` is 0, goes out of scope, or is otherwise destroyed&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
xref:BloombergLP/ball/LoggerManager.adoc[LoggerManager]&
xref:BloombergLP/ball/LoggerManager/initSingleton-0bd.adoc[initSingleton](
    xref:BloombergLP/ball/Observer.adoc[Observer]* observer,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* globalAllocator = 0);
----

[.small]#xref:BloombergLP/ball/LoggerManager/initSingleton-0bd.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, using the specified `configuration`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
xref:BloombergLP/ball/LoggerManager.adoc[LoggerManager]&
xref:BloombergLP/ball/LoggerManager/initSingleton-0f.adoc[initSingleton](
    xref:BloombergLP/ball/Observer.adoc[Observer]* observer,
    xref:BloombergLP/ball/LoggerManagerConfiguration.adoc[LoggerManagerConfiguration] const& configuration,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* globalAllocator = 0);
----

[.small]#xref:BloombergLP/ball/LoggerManager/initSingleton-0f.adoc[_» more&period;&period;&period;_]#


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