8 #include "Arp/System/Core/TypeName.hxx" 9 #include "Arp/System/Core/AppDomainSingleton.hxx" 10 #include "Arp/System/Commons/Threading/Mutex.hpp" 11 #include "Arp/System/Commons/Diagnostics/Logging/LogLevel.hpp" 12 #include "Arp/System/Commons/Diagnostics/Logging/Internal/LogAdapter.hpp" 27 namespace Arp {
namespace System {
namespace Commons {
namespace Diagnostics {
namespace Logging
31 using LogAdapter = Internal::LogAdapter;
43 LogManager(
const LogManager&) =
delete;
45 LogManager& operator=(
const LogManager&) =
delete;
48 static void AssignAppDomain(
AppDomain& otherDomain);
49 static void Create(
const char* configFileName);
50 static void Create(
bool enableConsoleLogging,
const char* logFileName =
nullptr);
51 static void Create(LogLevel logLevel,
bool enableConsoleLogging,
const char* logFileName =
nullptr);
52 static void Create(
const char* layoutPattern,
bool enableConsoleLogging,
const char* logFileName =
nullptr);
53 static void Create(LogLevel logLevel,
const char* layoutPattern,
bool enableConsoleLogging,
const char* logFileName =
nullptr);
54 static void Dispose(
void);
57 void SetRootLevel(LogLevel value);
58 LogLevel GetRootLevel(
void);
59 Mutex& GetSyncRoot(
void);
62 LogAdapter CreateLogAdapter(
const char* loggerName);
65 void Initialize(LogLevel rootLevel, log4cplus::Logger& rootLogger);
66 log4cplus::Logger GetLoggerInstance(
const char* loggerName);
70 LogAdapter::Ptr rootLogAdapterPtr;
71 log4cplus::Hierarchy* pRootHierarchy;
72 log4cplus::Initializer* pInitializer;
75 static const char*
const defaultLayoutPattern;
81 inline void LogManager::SetRootLevel(LogLevel value)
83 this->rootLogAdapterPtr->SetLogLevel(value);
86 inline LogLevel LogManager::GetRootLevel()
89 return this->rootLogAdapterPtr->logLevel;
92 inline Mutex& LogManager::GetSyncRoot()
94 return this->syncRoot;
97 inline void LogManager::Create(
bool enableConsoleLogging,
const char* logFileName)
99 Create(LogLevel::Default,
nullptr, enableConsoleLogging, logFileName);
102 inline void LogManager::Create(LogLevel logLevel,
bool enableConsoleLogging,
const char* logFileName)
104 Create(logLevel,
nullptr, enableConsoleLogging, logFileName);
107 inline void LogManager::Create(
const char* layoutPattern,
bool enableConsoleLogging,
const char* logFileName)
109 Create(LogLevel::Default, layoutPattern, enableConsoleLogging, logFileName);
Mutual exclusion object to prevent data from concurrent modifications.
Definition: Mutex.hpp:25
Definition: LogManager.hpp:34
This class represents a single application domain for each process and is implemented as singleton...
Definition: AppDomain.hpp:122
Namespace for classes handling threads and synchronization
Root namespace for the PLCnext API
This class implements the singleton pattern for singletons with process wide scope.
Definition: AppDomainSingleton.hxx:24
System components used by the System, Device, Plc or Io domains.
Definition: LogAdapter.hpp:14