CppTrail
Loading...
Searching...
No Matches
CppTrail Namespace Reference

Root namespace for the CppTrail logging library. More...

Classes

class  AsyncCerrLogger
 A specialized asynchronous logger handle targeting the standard error stream (std::cerr). More...
 
class  AsyncCoutLogger
 A specialized asynchronous logger handle targeting the standard output stream (std::cout). More...
 
class  BasicAsyncLoggerImpl
 An asynchronous logger template utilizing background worker threads and object recycling. This class decouples the logging call from the actual I/O operation. It maintains an internal queue of log entries and a pool of worker threads to process them. To minimize heap pressure, it uses a backup pool (object pool) to recycle linked-list nodes. More...
 
class  BasicAsyncOstreamLogger
 An asynchronous logger handle that dispatches output to a C++ standard stream. More...
 
class  BasicLogger
 A high-level handle for logging operations. More...
 
class  BasicLoggerImpl
 Abstract template interface defining the mandatory contract for all loggers. More...
 
class  BasicMessage
 Container for log message implementations. More...
 
class  BasicMessageImpl
 Abstract base class for message implementations. More...
 
class  BasicStringMessage
 A standard string-based log message. More...
 
class  BasicSyncLoggerImpl
 A synchronous, thread-safe logger implementation template. This class ensures that every log call is processed immediately on the calling thread. Access to the 'work' function is protected by a mutex, making it safe for multi-threaded environments, though it may introduce latency in the calling thread. More...
 
class  BasicSyncOstreamLogger
 A synchronous logger handle that directs output to a C++ standard output stream. More...
 
class  LoggerOverflowError
 Exception thrown when the logger queue exceeds its maximum allowed size. This exception is specifically utilized by AsyncLoggerImpl when m_bThrowOnOverflow is set to true and the incoming log rate exceeds the processing capacity of the worker threads. More...
 
class  SyncCerrLogger
 A specialized logger handle targeting the standard error stream (std::cerr). More...
 
class  SyncCoutLogger
 A specialized logger handle targeting the standard output stream (std::cout). More...
 

Typedefs

Logger Type Aliases

Standardized aliases for common character encodings.

using AsyncLoggerImpl = BasicAsyncLoggerImpl< char >
 Standard char-based logger (ASCII/UTF-8).
 
using wAsyncLoggerImpl = BasicAsyncLoggerImpl< wchar_t >
 Wide-character logger (Platform dependent, typically UTF-16 on Windows).
 
using u8AsyncLoggerImpl = BasicAsyncLoggerImpl< char8_t >
 Explicit UTF-8 logger using C++20 char8_t.
 
using u16AsyncLoggerImpl = BasicAsyncLoggerImpl< char16_t >
 UTF-16 logger using char16_t.
 
using u32AsyncLoggerImpl = BasicAsyncLoggerImpl< char32_t >
 UTF-32 logger using char32_t.
 
using LoggerImpl = BasicLoggerImpl< char >
 Standard char-based logger (ASCII/UTF-8).
 
using wLoggerImpl = BasicLoggerImpl< wchar_t >
 Wide-character logger (Platform dependent, typically UTF-16 on Windows).
 
using u8LoggerImpl = BasicLoggerImpl< char8_t >
 Explicit UTF-8 logger using C++20 char8_t.
 
using u16LoggerImpl = BasicLoggerImpl< char16_t >
 UTF-16 logger using char16_t.
 
using u32LoggerImpl = BasicLoggerImpl< char32_t >
 UTF-32 logger using char32_t.
 
using Logger = BasicLogger< char >
 Standard char-based logger (ASCII/UTF-8).
 
using wLogger = BasicLogger< wchar_t >
 Wide-character logger (Platform dependent, typically UTF-16 on Windows).
 
using u8Logger = BasicLogger< char8_t >
 Explicit UTF-8 logger using C++20 char8_t.
 
using u16Logger = BasicLogger< char16_t >
 UTF-16 logger using char16_t.
 
using u32Logger = BasicLogger< char32_t >
 UTF-32 logger using char32_t.
 
using SyncLoggerImpl = BasicSyncLoggerImpl< char >
 Standard char-based logger (ASCII/UTF-8).
 
using wSyncLoggerImpl = BasicSyncLoggerImpl< wchar_t >
 Wide-character logger (Platform dependent, typically UTF-16 on Windows).
 
using u8SyncLoggerImpl = BasicSyncLoggerImpl< char8_t >
 Explicit UTF-8 logger using C++20 char8_t.
 
using u16SyncLoggerImpl = BasicSyncLoggerImpl< char16_t >
 UTF-16 logger using char16_t.
 
using u32SyncLoggerImpl = BasicSyncLoggerImpl< char32_t >
 UTF-32 logger using char32_t.
 
BasicMessageImpl Type Aliases

Standardized aliases for common character encodings.

using MessageImpl = BasicMessageImpl< char >
 Standard char-based message (ASCII/UTF-8).
 
using wMessageImpl = BasicMessageImpl< wchar_t >
 Wide-character message (Platform dependent, typically UTF-16 on Windows).
 
using u8MessageImpl = BasicMessageImpl< char8_t >
 Explicit UTF-8 message using C++20 char8_t.
 
using u16MessageImpl = BasicMessageImpl< char16_t >
 UTF-16 message using char16_t.
 
using u32MessageImpl = BasicMessageImpl< char32_t >
 UTF-32 message using char32_t.
 
BasicMessage Type Aliases

Standardized aliases for common character encodings.

using Message = BasicMessage< char >
 Standard char-based message (ASCII/UTF-8).
 
using wMessage = BasicMessage< wchar_t >
 Wide-character message (Platform dependent, typically UTF-16 on Windows).
 
using u8Message = BasicMessage< char8_t >
 Explicit UTF-8 message using C++20 char8_t.
 
using u16Message = BasicMessage< char16_t >
 UTF-16 message using char16_t.
 
using u32Message = BasicMessage< char32_t >
 UTF-32 message using char32_t.
 
BasicStringMessage Type Aliases

Standardized aliases for common character encodings.

using StringMessage = BasicStringMessage< char >
 Standard char-based string message (ASCII/UTF-8).
 
using wStringMessage = BasicStringMessage< wchar_t >
 Wide-character string message (Platform dependent, typically UTF-16 on Windows).
 
using u8StringMessage = BasicStringMessage< char8_t >
 Explicit UTF-8 string message using C++20 char8_t.
 
using u16StringMessage = BasicStringMessage< char16_t >
 UTF-16 string message using char16_t.
 
using u32StringMessage = BasicStringMessage< char32_t >
 UTF-32 string message using char32_t.
 
OstreamLogger Type Aliases

Standardized aliases for common character encodings.

using SyncOstreamLogger = BasicSyncOstreamLogger< char >
 Standard char-based OstreamLogger (ASCII/UTF-8).
 
using wSyncOstreamLogger = BasicSyncOstreamLogger< wchar_t >
 Wide-character OstreamLogger (Platform dependent, typically UTF-16 on Windows).
 
using u8SyncOstreamLogger = BasicSyncOstreamLogger< char8_t >
 Explicit UTF-8 OstreamLogger using C++20 char8_t.
 
using u16SyncOstreamLogger = BasicSyncOstreamLogger< char16_t >
 UTF-16 OstreamLogger using char16_t.
 
using u32SyncOstreamLogger = BasicSyncOstreamLogger< char32_t >
 UTF-32 OstreamLogger using char32_t.
 
AsyncOstreamLogger Type Aliases

Standardized aliases for common character encodings.

using AsyncOstreamLogger = BasicAsyncOstreamLogger< char >
 Standard char-based AsyncOstreamLogger (ASCII/UTF-8).
 
using wAsyncOstreamLogger = BasicAsyncOstreamLogger< wchar_t >
 Wide-character AsyncOstreamLogger (Platform dependent, typically UTF-16 on Windows).
 
using u8AsyncOstreamLogger = BasicAsyncOstreamLogger< char8_t >
 Explicit UTF-8 AsyncOstreamLogger using C++20 char8_t.
 
using u16AsyncOstreamLogger = BasicAsyncOstreamLogger< char16_t >
 UTF-16 AsyncOstreamLogger using char16_t.
 
using u32AsyncOstreamLogger = BasicAsyncOstreamLogger< char32_t >
 UTF-32 AsyncOstreamLogger using char32_t.
 

Enumerations

enum class  Status { RUNNING , STOPPED , BROKEN , TRASCENDENT }
 Represents the current operational state of a Logger implementation. More...
 
enum class  Level {
  SUCCESS , TRACE , DEBUG , INFO ,
  MESSAGE , WARNING , ERROR , CRITICAL ,
  FATAL
}
 Severity levels for log entries. More...
 

Functions

String Getters (Allocating)

Functions that return a heap-allocated copy of the level name.

std::string getName (const Level nLevel)
 Gets the level name as a std::string.
 
std::u8string u8getName (const Level nLevel)
 Gets the level name as a std::u8string.
 
std::u16string u16getName (const Level nLevel)
 Gets the level name as a std::u16string.
 
std::u32string u32getName (const Level nLevel)
 Gets the level name as a std::u32string.
 
template<typename char_t >
std::basic_string< char_t > tgetName (const Level nLevel)
 Template version for generic character types (allocating).
 
StringView Getters (Non-allocating)

High-performance functions that return views to static memory.

Note
These functions are only available when compiling with C++17 or later.
std::string_view getNameView (const Level nLevel)
 Gets a view of the level name.
 
std::u8string_view u8getNameView (const Level nLevel)
 Gets a UTF-8 view of the level name.
 
std::u16string_view u16getNameView (const Level nLevel)
 Gets a UTF-16 view of the level name.
 
std::u32string_view u32getNameView (const Level nLevel)
 Gets a UTF-32 view of the level name.
 
template<typename char_t >
std::basic_string_view< char_t > tgetNameView (const Level nLevel)
 Template version for generic character types (non-allocating).
 

Detailed Description

Root namespace for the CppTrail logging library.

Enumeration Type Documentation

◆ Level

enum class CppTrail::Level
strong

Severity levels for log entries.

Enumerator
SUCCESS 

Positive confirmation of a successful operation.

TRACE 

Extremely fine-grained diagnostic events (wire-level).

DEBUG 

Information useful for application debugging.

INFO 

General operational messages about application progress.

MESSAGE 

High-level communication or protocol-specific messages.

WARNING 

Indications of potential issues or non-critical failures.

ERROR 

Significant issues that require attention but allow continued execution.

CRITICAL 

Severe failures that may lead to localized component shutdown.

FATAL 

Terminal errors that require immediate application termination.

◆ Status

enum class CppTrail::Status
strong

Represents the current operational state of a Logger implementation.

Enumerator
RUNNING 

The logger is active and processing entries.

STOPPED 

The logger has been gracefully shut down.

BROKEN 

The logger encountered a fatal error (e.g., IO failure).

TRASCENDENT 

The logger operates outside standard lifecycle management.

Function Documentation

◆ getName()

std::string CppTrail::getName ( const Level  nLevel)
inline

Gets the level name as a std::string.

Parameters
nLevelThe severity level to convert.
Returns
A string containing the name.

◆ getNameView()

std::string_view CppTrail::getNameView ( const Level  nLevel)
inline

Gets a view of the level name.

Parameters
nLevelThe severity level to convert.
Returns
A string view containing the name.

◆ tgetName()

template<typename char_t >
std::basic_string< char_t > CppTrail::tgetName ( const Level  nLevel)

Template version for generic character types (allocating).

Template Parameters
char_tThe character type to use.
Parameters
nLevelThe severity level to convert.
Returns
A basic string of type char_t containing the name.

◆ tgetNameView()

template<typename char_t >
std::basic_string_view< char_t > CppTrail::tgetNameView ( const Level  nLevel)

Template version for generic character types (non-allocating).

Template Parameters
char_tThe character type to use.
Parameters
nLevelThe severity level to convert.
Returns
A basic string view of type char_t containing the name.

◆ u16getName()

std::u16string CppTrail::u16getName ( const Level  nLevel)
inline

Gets the level name as a std::u16string.

Parameters
nLevelThe severity level to convert.
Returns
A UTF-16 string containing the name.

◆ u16getNameView()

std::u16string_view CppTrail::u16getNameView ( const Level  nLevel)
inline

Gets a UTF-16 view of the level name.

Parameters
nLevelThe severity level to convert.
Returns
A UTF-16 string view containing the name.

◆ u32getName()

std::u32string CppTrail::u32getName ( const Level  nLevel)
inline

Gets the level name as a std::u32string.

Parameters
nLevelThe severity level to convert.
Returns
A UTF-32 string containing the name.

◆ u32getNameView()

std::u32string_view CppTrail::u32getNameView ( const Level  nLevel)
inline

Gets a UTF-32 view of the level name.

Parameters
nLevelThe severity level to convert.
Returns
A UTF-32 string view containing the name.

◆ u8getName()

std::u8string CppTrail::u8getName ( const Level  nLevel)
inline

Gets the level name as a std::u8string.

Parameters
nLevelThe severity level to convert.
Returns
A UTF-8 string containing the name.

◆ u8getNameView()

std::u8string_view CppTrail::u8getNameView ( const Level  nLevel)
inline

Gets a UTF-8 view of the level name.

Parameters
nLevelThe severity level to convert.
Returns
A UTF-8 string view containing the name.