bux API Reference 1.9.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, const std::chrono::time_zone *tz_=nullptr)
 
 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
 
- Public Member Functions inherited from bux::I_SyncLog

Additional Inherited Members

- Public Attributes inherited from bux::I_SyncLog
const std::chrono::time_zone *const tz
 
- Protected Member Functions inherited from bux::I_SyncLog
 I_SyncLog (const std::chrono::time_zone *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,
const std::chrono::time_zone * tz_ = nullptr )
inlineexplicit

Definition at line 131 of file SyncLog.h.

◆ C_SyncLogger() [2/2]

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

Definition at line 132 of file SyncLog.h.

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.

References bux::I_ReenterableLog::useLog().

◆ 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.

References bux::I_ReenterableLog::useLog().

◆ 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.

References bux::I_ReenterableLog::unuseLog().


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