[#BCLog-Logger]
= xref:BCLog.adoc[BCLog]::Logger
:relfileprefix: ../
:mrdocs:

Central logger that formats entries and writes them to the console, a file and callbacks&period;

== Synopsis

Declared in `&lt;logging&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class Logger;
----

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BCLog/Logger/AddCategoryLogLevel.adoc[`AddCategoryLogLevel`] 
| Set the override log level for a single category&period;
| xref:BCLog/Logger/CategoryLevels.adoc[`CategoryLevels`] 
| Get the per&hyphen;category log levels&period;
| xref:BCLog/Logger/DefaultShrinkDebugFile.adoc[`DefaultShrinkDebugFile`] 
| Whether the debug log file should be shrunk on startup by default&period;
| xref:BCLog/Logger/DeleteCallback.adoc[`DeleteCallback`] 
| Delete a connection
| xref:BCLog/Logger/DisableCategory-0d.adoc[`DisableCategory`] 
| `DisableCategory` overloads
| xref:BCLog/Logger/DisableLogging.adoc[`DisableLogging`] 
| Disable logging This offers a slight speedup and slightly smaller memory usage compared to leaving the logging system in its default state&period; Mostly intended for libbitcoin&hyphen;kernel apps that don&apos;t want any logging&period; Should be used instead of StartLogging()&period;
| xref:BCLog/Logger/DisconnectTestLogger.adoc[`DisconnectTestLogger`] 
| Only for testing
| xref:BCLog/Logger/EnableCategory-09.adoc[`EnableCategory`] 
| `EnableCategory` overloads
| xref:BCLog/Logger/Enabled.adoc[`Enabled`] 
| Returns whether logs will be written to any output
| xref:BCLog/Logger/GetCategoryMask.adoc[`GetCategoryMask`] 
| Get the bitmask of enabled log categories&period;
| xref:BCLog/Logger/LogCategoriesList.adoc[`LogCategoriesList`] 
| Returns a vector of the log categories in alphabetical order&period;
| xref:BCLog/Logger/LogCategoriesString.adoc[`LogCategoriesString`] 
| Returns a string with the log categories in alphabetical order&period;
| xref:BCLog/Logger/LogLevel.adoc[`LogLevel`] 
| Get the current global log level&period;
| xref:BCLog/Logger/LogLevelsString.adoc[`LogLevelsString`] 
| Returns a string with all user&hyphen;selectable log levels&period;
| xref:BCLog/Logger/LogPrint.adoc[`LogPrint`] 
| Send an entry to the log output
| xref:BCLog/Logger/NumConnections.adoc[`NumConnections`] 
| Count the callbacks currently connected to the print signal&period;
| xref:BCLog/Logger/PushBackCallback.adoc[`PushBackCallback`] 
| Connect a slot to the print signal and return the connection
| xref:BCLog/Logger/SetCategoryLogLevel-0a.adoc[`SetCategoryLogLevel`] 
| `SetCategoryLogLevel` overloads
| xref:BCLog/Logger/SetLogLevel-02.adoc[`SetLogLevel`] 
| `SetLogLevel` overloads
| xref:BCLog/Logger/SetRateLimiting.adoc[`SetRateLimiting`] 
| Install the rate limiter used to throttle noisy log locations&period;
| xref:BCLog/Logger/ShrinkDebugFile.adoc[`ShrinkDebugFile`] 
| Shrink the debug log file to a reasonable size on startup&period;
| xref:BCLog/Logger/StartLogging.adoc[`StartLogging`] 
| Start logging (and flush all buffered messages)
| xref:BCLog/Logger/WillLogCategory.adoc[`WillLogCategory`] 
| Check whether a category is enabled at all&period;
| xref:BCLog/Logger/WillLogCategoryLevel.adoc[`WillLogCategoryLevel`] 
| Check whether a category would be logged at a given level&period;
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BCLog/Logger/GetLogCategory.adoc[`GetLogCategory`] 
| Return log flag if str parses as a log category&period;
| xref:BCLog/Logger/LogLevelToStr.adoc[`LogLevelToStr`] 
| Returns the string representation of a log level&period;
|===


== Data Members

[cols="1,4"]
|===
| Name| Description
| xref:BCLog/Logger/m_always_print_category_level.adoc[`m&lowbar;always&lowbar;print&lowbar;category&lowbar;level`] 
| Whether to always print the category and level&period;
| xref:BCLog/Logger/m_file_path.adoc[`m&lowbar;file&lowbar;path`] 
| Path of the debug log file&period;
| xref:BCLog/Logger/m_log_sourcelocations.adoc[`m&lowbar;log&lowbar;sourcelocations`] 
| Whether to include the source location&period;
| xref:BCLog/Logger/m_log_threadnames.adoc[`m&lowbar;log&lowbar;threadnames`] 
| Whether to include the originating thread name&period;
| xref:BCLog/Logger/m_log_time_micros.adoc[`m&lowbar;log&lowbar;time&lowbar;micros`] 
| Whether timestamps include microsecond precision&period;
| xref:BCLog/Logger/m_log_timestamps.adoc[`m&lowbar;log&lowbar;timestamps`] 
| Whether to prefix entries with a timestamp&period;
| xref:BCLog/Logger/m_print_to_console.adoc[`m&lowbar;print&lowbar;to&lowbar;console`] 
| Whether log entries are written to the console&period;
| xref:BCLog/Logger/m_print_to_file.adoc[`m&lowbar;print&lowbar;to&lowbar;file`] 
| Whether log entries are written to the debug log file&period;
| xref:BCLog/Logger/m_reopen_file.adoc[`m&lowbar;reopen&lowbar;file`] 
| Request to reopen the log file, e&period;g&period; after log rotation&period;
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:LogInstance.adoc[`&colon;&colon;LogInstance`]
| Access the global logger instance&period;
|===


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