PLCnext API Documentation 25.0.2.69
Public Types | Public Member Functions | List of all members
Arp::System::Commons::Diagnostics::Logging::LoggerBase Class Reference

This class shall be used as base class for all Logger. More...

#include <LoggerBase.hpp>

Inheritance diagram for Arp::System::Commons::Diagnostics::Logging::LoggerBase:
Inheritance graph

Public Types

using Impl = Log4Arp::Logger
 

Public Member Functions

 LoggerBase (const String &loggerName)
 Constructs an LoggerBase instance. More...
 
 LoggerBase (const LoggerBase &arg)
 Default copy constructor.
 
 LoggerBase (LoggerBase &&arg) noexcept
 Default move constructor.
 
LoggerBaseoperator= (const LoggerBase &arg)
 Default copy-assignment operator.
 
LoggerBaseoperator= (LoggerBase &&arg) noexcept
 Default move-assignment operator.
 
 ~LoggerBase (void)
 Default destructor.
 
String GetName (void) const
 Gets the name of this logger. More...
 
LogLevel GetLogLevel (void) const
 Gets the log level of this logger. More...
 
void InitializeOnce (const String &loggerName)
 Lazy initializes this logger instance once. More...
 
void Log (LogLevel severity, String &&message) const
 Logs the given message according the specified severity. More...
 
void Log (LogLevel severity, const String &message) const
 Logs the given message according the specified severity. More...
 
template<typename... Args>
void Trace (const char *format, const Args &... args) const
 Formats the supplied message and logs it if the log level of this logger is greater or equal than LogLevel::Trace. More...
 
template<typename... Args>
void Debug (const char *format, const Args &... args) const
 Formats the supplied message and logs it if the log level of this logger is greater or equal than LogLevel::Debug. More...
 
template<typename... Args>
void Info (const char *format, const Args &... args) const
 Formats the supplied message and logs it if the log level of this logger is greater or equal than LogLevel::Info. More...
 
template<typename... Args>
void Warning (const char *format, const Args &... args) const
 Formats the supplied message and logs it if the log level of this logger is greater or equal than LogLevel::Warning. More...
 
template<typename... Args>
void Critical (const char *format, const Args &... args) const
 Formats the supplied message and logs it if the log level of this logger is greater or equal than LogLevel::Critical. More...
 
template<typename... Args>
void Error (const char *format, const Args &... args) const
 Formats the supplied message and logs it if the log level of this logger is greater or equal than LogLevel::Error. More...
 
template<typename... Args>
void Fatal (const char *format, const Args &... args) const
 Formats the supplied message and logs it if the log level of this logger is greater or equal than LogLevel::Fatal. More...
 
template<typename... Args>
void PrintTrace (const char *format, const Args &... args) const
 Formats the supplied message in printf style and logs it if the log level of this logger is greater or equal than LogLevel::Trace. More...
 
template<typename... Args>
void PrintDebug (const char *format, const Args &... args) const
 Formats the supplied message in printf style and logs it if the log level of this logger is greater or equal than LogLevel::Debug. More...
 
template<typename... Args>
void PrintInfo (const char *format, const Args &... args) const
 Formats the supplied message in printf style and logs it if the log level of this logger is greater or equal than LogLevel::Info. More...
 
template<typename... Args>
void PrintWarning (const char *format, const Args &... args) const
 Formats the supplied message in printf style and logs it if the log level of this logger is greater or equal than LogLevel::Warning. More...
 
template<typename... Args>
void PrintCritical (const char *format, const Args &... args) const
 Formats the supplied message in printf style and logs it if the log level of this logger is greater or equal than LogLevel::Critical. More...
 
template<typename... Args>
void PrintError (const char *format, const Args &... args) const
 Formats the supplied message in printf style and logs it if the log level of this logger is greater or equal than LogLevel::Error. More...
 
template<typename... Args>
void PrintFatal (const char *format, const Args &... args) const
 Formats the supplied message in printf style and logs it if the log level of this logger is greater or equal than LogLevel::Fatal. More...
 
template<typename... Args>
void Log (LogLevel logLevel, const char *format, const Args &... args) const
 Formats the supplied message in printf style and logs it if the log level of this logger is greater or equal than the given severity. More...
 
template<typename... Args>
void Logf (LogLevel logLevel, const char *format, const Args &... args) const
 Formats the supplied message in printf style and logs it if the log level of this logger is greater or equal than the given severity. More...
 
Impl & GetImpl (void)
 For internal use only.
 
const Impl & GetImpl (void) const
 

Detailed Description

This class shall be used as base class for all Logger.

Constructor & Destructor Documentation

◆ LoggerBase()

Arp::System::Commons::Diagnostics::Logging::LoggerBase::LoggerBase ( const String loggerName)
explicit

Constructs an LoggerBase instance.

Parameters
valueSpecifies the initial value of property ...

Member Function Documentation

◆ Critical()

template<typename... Args>
void Arp::System::Commons::Diagnostics::Logging::LoggerBase::Critical ( const char *  format,
const Args &...  args 
) const
inline

Formats the supplied message and logs it if the log level of this logger is greater or equal than LogLevel::Critical.

Template Parameters
...ArgsThe types of the message arguments.
Parameters
formatThe format string of the message.
...argsThe arguments to be formatted into the <paramref="format"/> string.

The log message is only formatted, if its not ommitted by its severity.

◆ Debug()

template<typename... Args>
void Arp::System::Commons::Diagnostics::Logging::LoggerBase::Debug ( const char *  format,
const Args &...  args 
) const
inline

Formats the supplied message and logs it if the log level of this logger is greater or equal than LogLevel::Debug.

Template Parameters
...ArgsThe types of the message arguments.
Parameters
formatThe format string of the message.
...argsThe arguments to be formatted into the <paramref="format"/> string.

The log message is only formatted, if its not ommitted by its severity.

◆ Error()

template<typename... Args>
void Arp::System::Commons::Diagnostics::Logging::LoggerBase::Error ( const char *  format,
const Args &...  args 
) const
inline

Formats the supplied message and logs it if the log level of this logger is greater or equal than LogLevel::Error.

Template Parameters
...ArgsThe types of the message arguments.
Parameters
formatThe format string of the message.
...argsThe arguments to be formatted into the <paramref="format"/> string.

The log message is only formatted, if its not ommitted by its severity.

◆ Fatal()

template<typename... Args>
void Arp::System::Commons::Diagnostics::Logging::LoggerBase::Fatal ( const char *  format,
const Args &...  args 
) const
inline

Formats the supplied message and logs it if the log level of this logger is greater or equal than LogLevel::Fatal.

Template Parameters
...ArgsThe types of the message arguments.
Parameters
formatThe format string of the message.
...argsThe arguments to be formatted into the <paramref="format"/> string.

The log message is only formatted, if its not ommitted by its severity.

◆ GetLogLevel()

LogLevel Arp::System::Commons::Diagnostics::Logging::LoggerBase::GetLogLevel ( void  ) const

Gets the log level of this logger.

Returns
The log level of this logger.

If the log level of this logger was not set, the root log level is returned.

◆ GetName()

String Arp::System::Commons::Diagnostics::Logging::LoggerBase::GetName ( void  ) const

Gets the name of this logger.

Returns
The name of this logger.

◆ Info()

template<typename... Args>
void Arp::System::Commons::Diagnostics::Logging::LoggerBase::Info ( const char *  format,
const Args &...  args 
) const
inline

Formats the supplied message and logs it if the log level of this logger is greater or equal than LogLevel::Info.

Template Parameters
...ArgsThe types of the message arguments.
Parameters
formatThe format string of the message.
...argsThe arguments to be formatted into the <paramref="format"/> string.

The log message is only formatted, if its not ommitted by its severity.

◆ InitializeOnce()

void Arp::System::Commons::Diagnostics::Logging::LoggerBase::InitializeOnce ( const String loggerName)

Lazy initializes this logger instance once.

Parameters
loggerNameThe logger name of this logger.

◆ Log() [1/3]

template<typename... Args>
void Arp::System::Commons::Diagnostics::Logging::LoggerBase::Log ( LogLevel  severity,
const char *  format,
const Args &...  args 
) const
inline

Formats the supplied message in printf style and logs it if the log level of this logger is greater or equal than the given severity.

Template Parameters
...ArgsThe types of the message arguments.
Parameters
severityThe severity of the message.
formatThe format string of the message.
...argsThe arguments to be formatted into the <paramref="format"/> string.

The log message is only formatted, if its not ommitted by its severity.

◆ Log() [2/3]

void Arp::System::Commons::Diagnostics::Logging::LoggerBase::Log ( LogLevel  severity,
const String message 
) const

Logs the given message according the specified severity.

Parameters
severityThe severity of the log message.
messageThe log message to be logged.

The log message is only logged, if the severity is less or equal than the actual log level of this logger.

See also
GetLogLevel

◆ Log() [3/3]

void Arp::System::Commons::Diagnostics::Logging::LoggerBase::Log ( LogLevel  severity,
String &&  message 
) const

Logs the given message according the specified severity.

Parameters
severityThe severity of the log message.
messageThe log message to be logged.

The log message is only logged, if the severity is less or equal than the actual log level of this logger.

See also
GetLogLevel

◆ Logf()

template<typename... Args>
void Arp::System::Commons::Diagnostics::Logging::LoggerBase::Logf ( LogLevel  severity,
const char *  format,
const Args &...  args 
) const
inline

Formats the supplied message in printf style and logs it if the log level of this logger is greater or equal than the given severity.

Template Parameters
...ArgsThe types of the message arguments.
Parameters
severityThe severity of the message.
formatThe format string of the message.
...argsThe arguments to be formatted into the <paramref="format"/> string.

The log message is only formatted, if its not ommitted by its severity.

◆ PrintCritical()

template<typename... Args>
void Arp::System::Commons::Diagnostics::Logging::LoggerBase::PrintCritical ( const char *  format,
const Args &...  args 
) const
inline

Formats the supplied message in printf style and logs it if the log level of this logger is greater or equal than LogLevel::Critical.

Template Parameters
...ArgsThe types of the message arguments.
Parameters
formatThe format string of the message.
...argsThe arguments to be formatted into the <paramref="format"/> string.

The log message is only formatted, if its not ommitted by its severity.

◆ PrintDebug()

template<typename... Args>
void Arp::System::Commons::Diagnostics::Logging::LoggerBase::PrintDebug ( const char *  format,
const Args &...  args 
) const
inline

Formats the supplied message in printf style and logs it if the log level of this logger is greater or equal than LogLevel::Debug.

Template Parameters
...ArgsThe types of the message arguments.
Parameters
formatThe format string of the message.
...argsThe arguments to be formatted into the <paramref="format"/> string.

The log message is only formatted, if its not ommitted by its severity.

◆ PrintError()

template<typename... Args>
void Arp::System::Commons::Diagnostics::Logging::LoggerBase::PrintError ( const char *  format,
const Args &...  args 
) const
inline

Formats the supplied message in printf style and logs it if the log level of this logger is greater or equal than LogLevel::Error.

Template Parameters
...ArgsThe types of the message arguments.
Parameters
formatThe format string of the message.
...argsThe arguments to be formatted into the <paramref="format"/> string.

The log message is only formatted, if its not ommitted by its severity.

◆ PrintFatal()

template<typename... Args>
void Arp::System::Commons::Diagnostics::Logging::LoggerBase::PrintFatal ( const char *  format,
const Args &...  args 
) const
inline

Formats the supplied message in printf style and logs it if the log level of this logger is greater or equal than LogLevel::Fatal.

Template Parameters
...ArgsThe types of the message arguments.
Parameters
formatThe format string of the message.
...argsThe arguments to be formatted into the <paramref="format"/> string.

The log message is only formatted, if its not ommitted by its severity.

◆ PrintInfo()

template<typename... Args>
void Arp::System::Commons::Diagnostics::Logging::LoggerBase::PrintInfo ( const char *  format,
const Args &...  args 
) const
inline

Formats the supplied message in printf style and logs it if the log level of this logger is greater or equal than LogLevel::Info.

Template Parameters
...ArgsThe types of the message arguments.
Parameters
formatThe format string of the message.
...argsThe arguments to be formatted into the <paramref="format"/> string.

The log message is only formatted, if its not ommitted by its severity.

◆ PrintTrace()

template<typename... Args>
void Arp::System::Commons::Diagnostics::Logging::LoggerBase::PrintTrace ( const char *  format,
const Args &...  args 
) const
inline

Formats the supplied message in printf style and logs it if the log level of this logger is greater or equal than LogLevel::Trace.

Template Parameters
...ArgsThe types of the message arguments.
Parameters
formatThe format string of the message.
...argsThe arguments to be formatted into the <paramref="format"/> string.

The log message is only formatted, if its not ommitted by its severity.

◆ PrintWarning()

template<typename... Args>
void Arp::System::Commons::Diagnostics::Logging::LoggerBase::PrintWarning ( const char *  format,
const Args &...  args 
) const
inline

Formats the supplied message in printf style and logs it if the log level of this logger is greater or equal than LogLevel::Warning.

Template Parameters
...ArgsThe types of the message arguments.
Parameters
formatThe format string of the message.
...argsThe arguments to be formatted into the <paramref="format"/> string.

The log message is only formatted, if its not ommitted by its severity.

◆ Trace()

template<typename... Args>
void Arp::System::Commons::Diagnostics::Logging::LoggerBase::Trace ( const char *  format,
const Args &...  args 
) const
inline

Formats the supplied message and logs it if the log level of this logger is greater or equal than LogLevel::Trace.

Template Parameters
...ArgsThe types of the message arguments.
Parameters
formatThe format string of the message.
...argsThe arguments to be formatted into the <paramref="format"/> string.

The log message is only formatted, if its not ommitted by its severity.

◆ Warning()

template<typename... Args>
void Arp::System::Commons::Diagnostics::Logging::LoggerBase::Warning ( const char *  format,
const Args &...  args 
) const
inline

Formats the supplied message and logs it if the log level of this logger is greater or equal than LogLevel::Warning.

Template Parameters
...ArgsThe types of the message arguments.
Parameters
formatThe format string of the message.
...argsThe arguments to be formatted into the <paramref="format"/> string.

The log message is only formatted, if its not ommitted by its severity.


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