PLCnext API Documentation 25.0.2.69
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
17class ARP_CXX_SYMBOL_EXPORT LogManager
18{
19public: // Impl forward declaration
20 class Impl;
21 friend class Impl;
22
23public: // usings
24 using Instance = LogManager;
25 using LogEventDelegate = delegate<void(const LogEvent&)>;
26
27public: // construction/copy/move/assign/destruction
28 LogManager(void);
29 explicit LogManager(const LogSettings& logSettings);
30 LogManager(const LogManager& arg) = delete;
31 LogManager(LogManager&& arg)noexcept = delete;
32 LogManager& operator=(const LogManager& arg) = delete;
33 LogManager& operator=(LogManager&& arg)noexcept = delete;
35
36public: // static singleton operations
37 static void CreateInstance(const LogSettings& logSettings);
38 static bool IsCreated(void);
39 static void DisposeInstance(void);
40 static Instance& GetInstance(void);
41
42public: // setter/getter operations
43 void SetRootLevel(LogLevel value);
44 LogLevel GetRootLevel(void)const;
45
46public: // operations
47 void AddLogEventDelegate(LogEventDelegate delegator);
48 void RemoveLogEventDelegate(LogEventDelegate delegator);
49
50public: // internal operations
51 Impl& GetImpl(void);
52 const Impl& GetImpl(void)const;
53
54private: // Impl usings
55 using Pimpl = PimplPtr<Impl>;
56
57private: // Impl fields
58 Pimpl pimpl;
59};
60
61}}}}} // 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:18
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