Safeheron-SGX-Native-Development-Framework v1.2.0
Loading...
Searching...
No Matches
ssgx::log_t::SSGXLogger Class Reference

Singleton class for managing logging within the SGX library. More...

#include <ssgx_log_t_logger.h>

Public Member Functions

void SetTraceId (const std::string &trace_id)
 Sets a trace ID for log messages.
 
 SSGXLogger (const SSGXLogger &)=delete
 
SSGXLoggeroperator= (const SSGXLogger &)=delete
 

Static Public Member Functions

static SSGXLoggerGetInstance ()
 Retrieves the singleton instance of SSGXLogger.
 

Detailed Description

Singleton class for managing logging within the SGX library.

This class provides a centralized logging interface for the SGX library. It supports log level configuration, trace ID management, and the ability to initialize a logger with file and console appenders.

Usage:

auto& logger = SSGXLogger::GetInstance();
logger.SetTraceId("12345");
static SSGXLogger & GetInstance()
Retrieves the singleton instance of SSGXLogger.

Constructor & Destructor Documentation

◆ SSGXLogger()

ssgx::log_t::SSGXLogger::SSGXLogger ( const SSGXLogger & )
delete

Member Function Documentation

◆ GetInstance()

static SSGXLogger & ssgx::log_t::SSGXLogger::GetInstance ( )
static

Retrieves the singleton instance of SSGXLogger.

This method provides thread-safe access to the single instance of the logger.

Returns
Reference to the singleton instance of SSGXLogger.

◆ operator=()

SSGXLogger & ssgx::log_t::SSGXLogger::operator= ( const SSGXLogger & )
delete

◆ SetTraceId()

void ssgx::log_t::SSGXLogger::SetTraceId ( const std::string & trace_id)

Sets a trace ID for log messages.

The trace ID is stored in the logging context and can be used to correlate log messages across different parts of the application. To include the trace ID in log messages, the log pattern must contain X{TraceId}.

Example:

void SetTraceId(const std::string &trace_id)
Sets a trace ID for log messages.
Parameters
trace_idThe trace ID string to be included in subsequent log messages.

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