bux API Reference 1.11.0
Static library of whatever are seen required in general purpose but not directly supported from Modern C++. Or whatever reusable originated from my side projects.
Loading...
Searching...
No Matches
bux::C_SyncLogger Class Reference

#include <SyncLog.h>

Inheritance diagram for bux::C_SyncLogger:

Public Member Functions

 C_SyncLogger (I_ReenterableLog &impl, T_LocalZone tz_=T_LocalZone())
 
 C_SyncLogger (I_ReenterableLog &impl, bool use_local_time)
 
std::ostream * lockLog () override
 
std::ostream * lockLog (E_LogLevel ll) override
 
void unlockLog (bool flush) override
 

Additional Inherited Members

- Public Attributes inherited from bux::I_SyncLog
const T_LocalZone tz
 
- Protected Member Functions inherited from bux::I_SyncLog
 I_SyncLog (T_LocalZone tz_)
 
 ~I_SyncLog ()=default
 Pointer deletion is not expected.
 

Detailed Description

Simplest thread-safe logger wrapper. Apply bux::C_UseLog to block any other thread from using it.

Examples
test/test_logger.cpp.

Definition at line 122 of file SyncLog.h.

Constructor & Destructor Documentation

◆ C_SyncLogger() [1/2]

bux::C_SyncLogger::C_SyncLogger ( I_ReenterableLog & impl,
T_LocalZone tz_ = T_LocalZone() )
inlineexplicit

Definition at line 131 of file SyncLog.h.

References bux::I_SyncLog::I_SyncLog().

Referenced by C_SyncLogger().

Here is the caller graph for this function:

◆ C_SyncLogger() [2/2]

bux::C_SyncLogger::C_SyncLogger ( I_ReenterableLog & impl,
bool use_local_time )
inlineexplicit

Definition at line 133 of file SyncLog.h.

References C_SyncLogger(), and bux::local_zone().

Member Function Documentation

◆ lockLog() [1/2]

std::ostream * bux::C_SyncLogger::lockLog ( )
overridevirtual
Returns
the std::ostream representitive of the locked logger

Lock the logger without log level, for prefix-less log lines

Implements bux::I_SyncLog.

Examples
test/test_logger.cpp.

Definition at line 9 of file SyncLog.cpp.

◆ lockLog() [2/2]

std::ostream * bux::C_SyncLogger::lockLog ( E_LogLevel ll)
overridevirtual
Parameters
[in]llLog level
Returns
the std::ostream representitive of the locked logger

Lock the logger with log level, for prefixed log lines

Implements bux::I_SyncLog.

Definition at line 23 of file SyncLog.cpp.

◆ unlockLog()

void bux::C_SyncLogger::unlockLog ( bool flush)
overridevirtual
Parameters
[in]flushIndicating if the logger should flush upon unlock.

Unlock the logger, with or without log level.

Implements bux::I_SyncLog.

Definition at line 38 of file SyncLog.cpp.


The documentation for this class was generated from the following files: