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

This singleton class is used to initialize and configure the Arp logging. More...

#include <LogManager.hpp>

Public Types

using Instance = LogManager
 
using LogEventDelegate = delegate< void(const LogEvent &)>
 

Public Member Functions

 LogManager (void)
 Constructs an LogManager instance.
 
 LogManager (const LogSettings &logSettings)
 Constructs an LogManager instance. More...
 
 LogManager (const LogManager &arg)=delete
 
 LogManager (LogManager &&arg) noexcept=delete
 
LogManageroperator= (const LogManager &arg)=delete
 
LogManageroperator= (LogManager &&arg) noexcept=delete
 
 ~LogManager (void)
 Default destructor.
 
void SetRootLevel (LogLevel value)
 Sets the root log level. More...
 
LogLevel GetRootLevel (void) const
 Gets the current root log level. More...
 
void AddLogEventDelegate (LogEventDelegate delegator)
 Subscribes a log event delegator to obtain any log events. More...
 
void RemoveLogEventDelegate (LogEventDelegate delegator)
 Removes a subscribed log event delegator. More...
 
Impl & GetImpl (void)
 For internal use only.
 
const Impl & GetImpl (void) const
 

Static Public Member Functions

static void CreateInstance (const LogSettings &logSettings)
 Creates this singleton instance. More...
 
static bool IsCreated (void)
 Determines if this singleton instance is created yet. More...
 
static void DisposeInstance (void)
 Disposes this singleton instance. More...
 
static InstanceGetInstance (void)
 Gets a reference of the singleton instance. More...
 

Friends

class Impl
 

Detailed Description

This singleton class is used to initialize and configure the Arp logging.

Call CreateInstance once to initialize the log engine.

Constructor & Destructor Documentation

◆ LogManager()

Arp::System::Commons::Diagnostics::Logging::LogManager::LogManager ( const LogSettings logSettings)
explicit

Constructs an LogManager instance.

Parameters
logSettingsThe log settings used for initialization.

Member Function Documentation

◆ AddLogEventDelegate()

void Arp::System::Commons::Diagnostics::Logging::LogManager::AddLogEventDelegate ( LogEventDelegate  delegator)

Subscribes a log event delegator to obtain any log events.

Parameters
delegatorThe delgator to invoke on each log event.

◆ CreateInstance()

void Arp::System::Commons::Diagnostics::Logging::LogManager::CreateInstance ( const LogSettings logSettings)
static

Creates this singleton instance.

Parameters
logSettingsThe log settings used for initialization.

◆ DisposeInstance()

void Arp::System::Commons::Diagnostics::Logging::LogManager::DisposeInstance ( void  )
static

Disposes this singleton instance.

Deletes the singleton instance pointer.

◆ GetInstance()

LogManager::Instance & Arp::System::Commons::Diagnostics::Logging::LogManager::GetInstance ( void  )
static

Gets a reference of the singleton instance.

Returns
The singleton instance as reference.
Exceptions
ExceptionIf this singleton instance was not created yet.

◆ GetRootLevel()

LogLevel Arp::System::Commons::Diagnostics::Logging::LogManager::GetRootLevel ( void  ) const

Gets the current root log level.

Returns
The current root log level.

◆ IsCreated()

bool Arp::System::Commons::Diagnostics::Logging::LogManager::IsCreated ( void  )
static

Determines if this singleton instance is created yet.

Returns
true if this singleton was created yet, otherwise false.

◆ RemoveLogEventDelegate()

void Arp::System::Commons::Diagnostics::Logging::LogManager::RemoveLogEventDelegate ( LogEventDelegate  delegator)

Removes a subscribed log event delegator.

Parameters
delegatorThe delgator to remove.

◆ SetRootLevel()

void Arp::System::Commons::Diagnostics::Logging::LogManager::SetRootLevel ( LogLevel  value)

Sets the root log level.

Parameters
valueThe new root log level.

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