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_ReenterableLogger< C_SinkRefHolder > Class Template Reference

#include <SyncLog.h>

Inheritance diagram for bux::C_ReenterableLogger< C_SinkRefHolder >:

Public Member Functions

template<typename T >
 C_ReenterableLogger (T &ref, E_LogLevel max_ll=LL_VERBOSE)
 
auto setLogLevel (E_LogLevel level)
 
auto lockedCount () const
 
std::ostream * useLog () override
 Return non-null pointer if possible.
 
std::ostream * useLog (E_LogLevel ll) override
 Return non-null pointer if logging is permitted to log level ll.
 
void unuseLog (bool flush) override
 If the previous call to lockLog() returned null, the behavior is undefined.
 
- Public Member Functions inherited from bux::I_ReenterableLog
virtual ~I_ReenterableLog ()=default
 Pointer deletion is hereby granted.
 

Detailed Description

template<class C_SinkRefHolder>
requires requires (C_SinkRefHolder holder) { { holder.stream() }-> std::convertible_to<std::ostream*>; holder.reset(); }
class bux::C_ReenterableLogger< C_SinkRefHolder >

Thread-unsafe logger wrapper, which is basic building block of bux::C_ParaLog Instead, the derived C_SyncLogger implements thread safety.

Examples
test/test_logger.cpp.

Definition at line 51 of file SyncLog.h.

Constructor & Destructor Documentation

◆ C_ReenterableLogger()

template<class C_SinkRefHolder >
template<typename T >
bux::C_ReenterableLogger< C_SinkRefHolder >::C_ReenterableLogger ( T & ref,
E_LogLevel max_ll = LL_VERBOSE )
inlineexplicit

Definition at line 60 of file SyncLog.h.

Member Function Documentation

◆ lockedCount()

template<class C_SinkRefHolder >
auto bux::C_ReenterableLogger< C_SinkRefHolder >::lockedCount ( ) const
inline

Definition at line 69 of file SyncLog.h.

◆ setLogLevel()

template<class C_SinkRefHolder >
auto bux::C_ReenterableLogger< C_SinkRefHolder >::setLogLevel ( E_LogLevel level)
inline

Definition at line 63 of file SyncLog.h.

◆ unuseLog()

template<class C_SinkRefHolder >
void bux::C_ReenterableLogger< C_SinkRefHolder >::unuseLog ( bool flush)
inlineoverridevirtual

If the previous call to lockLog() returned null, the behavior is undefined.

Implements bux::I_ReenterableLog.

Definition at line 85 of file SyncLog.h.

◆ useLog() [1/2]

template<class C_SinkRefHolder >
std::ostream * bux::C_ReenterableLogger< C_SinkRefHolder >::useLog ( )
inlineoverridevirtual

Return non-null pointer if possible.

Implements bux::I_ReenterableLog.

Definition at line 72 of file SyncLog.h.

Referenced by bux::C_ReenterableLogger< C_SinkRefHolder >::useLog().

Here is the caller graph for this function:

◆ useLog() [2/2]

template<class C_SinkRefHolder >
std::ostream * bux::C_ReenterableLogger< C_SinkRefHolder >::useLog ( E_LogLevel ll)
inlineoverridevirtual

Return non-null pointer if logging is permitted to log level ll.

Implements bux::I_ReenterableLog.

Definition at line 81 of file SyncLog.h.

References bux::C_ReenterableLogger< C_SinkRefHolder >::useLog().


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