Skip to main content

DPF C++ Client Library 2025 R2

ansys::dpf::core::logging::LoggerConfig Class Reference

Last update: 16.07.2025

The configuration associated to a Logger. It allows setting the log level and the sinks of a logger. More...

#include <dpf_api.h>

Public Member Functions

 LoggerConfig ()
 Construct a new Logger Config object.
 
eLogLevel getLogLevel () const
 Get the loglevel for the Logger. More...
 
std::set< eLoggerSink > const & getSinks () const
 Get the list of sink types supported by the Logger. More...
 
LoggerConfigwithLogLevel (eLogLevel log_level)
 Sets the log level for the Logger. More...
 
LoggerConfigwithSinks (eLoggerSink sink)
 Sets a single sink for the Logger to write to. More...
 
LoggerConfigwithSinks (std::set< eLoggerSink > const &sinks)
 Sets a list of sinks for the Logger to write to. More...
 

Static Public Member Functions

static LoggerConfig defaultConfig ()
 Returns the default config for logging. More...
 

Detailed Description

The configuration associated to a Logger. It allows setting the log level and the sinks of a logger.

Member Function Documentation

◆ defaultConfig()

static LoggerConfig ansys::dpf::core::logging::LoggerConfig::defaultConfig ( )
static

Returns the default config for logging.

Returns
LoggerConfig

◆ getLogLevel()

eLogLevel ansys::dpf::core::logging::LoggerConfig::getLogLevel ( ) const

Get the loglevel for the Logger.

Returns
eLogLevel

◆ getSinks()

std::set< eLoggerSink > const & ansys::dpf::core::logging::LoggerConfig::getSinks ( ) const

Get the list of sink types supported by the Logger.

Returns
std::set<eLoggerSink> const&

◆ withLogLevel()

LoggerConfig & ansys::dpf::core::logging::LoggerConfig::withLogLevel ( eLogLevel  log_level)

Sets the log level for the Logger.

Parameters
log_levelThe Logger loglevel.
Returns
LoggerConfig&

◆ withSinks() [1/2]

LoggerConfig & ansys::dpf::core::logging::LoggerConfig::withSinks ( eLoggerSink  sink)

Sets a single sink for the Logger to write to.

Parameters
sinkThe sink to write to.
Returns
LoggerConfig&

◆ withSinks() [2/2]

LoggerConfig & ansys::dpf::core::logging::LoggerConfig::withSinks ( std::set< eLoggerSink > const &  sinks)

Sets a list of sinks for the Logger to write to.

Parameters
sinksThe sinks to write to.
Returns
LoggerConfig&

Connect with Ansys