PLCnext API Documentation 25.6.0.37
LogManager.hpp
1
2//
3// Copyright Phoenix Contact GmbH & Co. KG
4//
6#pragma once
8#include "Arp/Base/Core/delegate.hxx"
9#include "Arp/System/Commons/Diagnostics/Logging/LogEvent.hpp"
10#include "Arp/System/Commons/Diagnostics/Logging/LogSettings.hpp"
11
12namespace Arp { namespace System { namespace Commons { namespace Diagnostics { namespace Logging
13{
14
18class ARP_CXX_SYMBOL_EXPORT LogManager
19{
20public: // Impl forward declaration
21 class Impl;
22 friend class Impl;
23
24public: // usings
25 using Instance = LogManager;
26 using LogEventDelegate = delegate<void(const LogEvent&)>;
27
28public: // construction/copy/move/assign/destruction
29 LogManager(void);
30 explicit LogManager(const LogSettings& logSettings);
31 LogManager(const LogManager& arg) = delete;
32 LogManager(LogManager&& arg)noexcept = delete;
33 LogManager& operator=(const LogManager& arg) = delete;
34 LogManager& operator=(LogManager&& arg)noexcept = delete;
36
37public: // static singleton operations
38 static void CreateInstance(const LogSettings& logSettings);
39 static bool IsCreated(void);
40 static void DisposeInstance(void);
41 static Instance& GetInstance(void);
42
43public: // setter/getter operations
44 void SetRootLevel(LogLevel value);
45 LogLevel GetRootLevel(void)const;
46
47public: // operations
48 void AddLogEventDelegate(LogEventDelegate delegator);
49 void RemoveLogEventDelegate(LogEventDelegate delegator);
50
51public: // internal operations
52 Impl& GetImpl(void);
53 const Impl& GetImpl(void)const;
54
55private: // Impl usings
56 using Pimpl = PimplPtr<Impl>;
57
58private: // Impl fields
59 Pimpl pimpl;
60};
61
62}}}}} // end of namespace Arp::System::Commons::Diagnostics::Logging
Adapter class to implement PImpl idiom.
Definition: PimplPtr.hxx:15
Prototyping of delegate template.
Definition: delegate.hxx:14
This class is used to forward log events from LogEngine.
Definition: LogEvent.hpp:24
This singleton class is used to initialize and configure the Arp logging.
Definition: LogManager.hpp:19
This class is used to compound all log settings of the application for initializing the log engine.
Definition: LogSettings.hpp:25
Root namespace for the PLCnext API