DotNetDupe
4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Toggle main menu visibility
Loading...
Searching...
No Matches
LogManager.h
Go to the documentation of this file.
1
#pragma once
2
#include "
Common.h
"
3
#include "
System/String.h
"
4
#include "
System/SmartPointer.h
"
5
#include "
Extensions/Logging/ILogger.h
"
6
#include "
Extensions/Logging/Logger.h
"
7
#include "
Extensions/Logging/LoggerConfiguration.h
"
8
#include <typeinfo>
9
10
namespace
DotNetDupe
{
11
namespace
Extensions
{
12
namespace
Logging
{
13
18
class
LogManager
:
public
DotNetDupe::System::Object
{
19
public
:
23
DOTNETDUPE_API
static
DotNetDupe::System::SmartPointer<ILogger>
GetLogger
(
const
DotNetDupe::System::String
& sCategoryName);
24
28
template
<
typename
T>
29
static
DotNetDupe::System::SmartPointer<ILoggerOf<T>
>
GetLogger
() {
30
DotNetDupe::System::String
sCategoryName =
typeid
(T).name();
31
return
DotNetDupe::System::SmartPointer<Logger<T>
>::NewShared(
GetLogger
(sCategoryName));
32
}
33
37
DOTNETDUPE_API
static
DotNetDupe::System::SmartPointer<ILogger>
GetConsoleLogger
(
const
DotNetDupe::System::String
& sCategoryName);
38
42
DOTNETDUPE_API
static
DotNetDupe::System::SmartPointer<ILogger>
GetFileLogger
(
const
DotNetDupe::System::String
& sCategoryName);
43
46
DOTNETDUPE_API
static
void
Configure
(
const
LoggerConfiguration
& config);
47
50
DOTNETDUPE_API
static
const
LoggerConfiguration
&
GetConfiguration
();
51
54
DOTNETDUPE_API
static
void
AddProvider
(
const
DotNetDupe::System::SmartPointer<ILoggerProvider>
& pProvider);
55
57
DOTNETDUPE_API
static
void
Reset
();
58
};
59
60
}
61
}
62
}
Common.h
Defines common cross-platform macros, export decorators, and fundamental types.
DOTNETDUPE_API
#define DOTNETDUPE_API
Platform-specific linkage decoration for exporting or importing library symbols.
Definition
Common.h:20
ILogger.h
Logger.h
LoggerConfiguration.h
SmartPointer.h
Provides reference-counted and weak pointer memory management primitives ensuring zero raw ownership.
String.h
High-performance UTF-8 / UTF-16 string manipulation class mirroring .NET System.String.
DotNetDupe::Extensions::Logging::LogManager
Central thread-safe static registry and entry point for application logging.
Definition
LogManager.h:18
DotNetDupe::Extensions::Logging::LogManager::GetConsoleLogger
static DotNetDupe::System::SmartPointer< ILogger > GetConsoleLogger(const DotNetDupe::System::String &sCategoryName)
Creates a dedicated ConsoleLogger instance for the specified category.
Definition
LogManager.cpp:56
DotNetDupe::Extensions::Logging::LogManager::Reset
static void Reset()
Resets the LogManager state, releasing all cached loggers and providers.
Definition
LogManager.cpp:125
DotNetDupe::Extensions::Logging::LogManager::GetLogger
static DotNetDupe::System::SmartPointer< ILogger > GetLogger(const DotNetDupe::System::String &sCategoryName)
Retrieves or creates a cached ILogger instance for the given category name.
Definition
LogManager.cpp:38
DotNetDupe::Extensions::Logging::LogManager::GetFileLogger
static DotNetDupe::System::SmartPointer< ILogger > GetFileLogger(const DotNetDupe::System::String &sCategoryName)
Creates a dedicated FileLogger instance for the specified category.
Definition
LogManager.cpp:74
DotNetDupe::Extensions::Logging::LogManager::GetConfiguration
static const LoggerConfiguration & GetConfiguration()
Gets the active global LoggerConfiguration.
Definition
LogManager.cpp:108
DotNetDupe::Extensions::Logging::LogManager::AddProvider
static void AddProvider(const DotNetDupe::System::SmartPointer< ILoggerProvider > &pProvider)
Adds an ILoggerProvider to the internal global LoggerFactory.
Definition
LogManager.cpp:114
DotNetDupe::Extensions::Logging::LogManager::GetLogger
static DotNetDupe::System::SmartPointer< ILoggerOf< T > > GetLogger()
Retrieves a strongly-typed ILoggerOf<T> where the category name is derived from type T.
Definition
LogManager.h:29
DotNetDupe::Extensions::Logging::LogManager::Configure
static void Configure(const LoggerConfiguration &config)
Sets the global LoggerConfiguration applied across created loggers.
Definition
LogManager.cpp:92
DotNetDupe::System::Object
Supports all classes in the DotNetDupe class hierarchy.
Definition
Object.h:18
DotNetDupe::System::SmartPointer
A unified smart pointer that supports both unique and shared ownership semantics.
Definition
SmartPointer.h:72
DotNetDupe::System::String
Represents text as a sequence of UTF-8 code units with culture-invariant operations.
Definition
String.h:74
DotNetDupe::Extensions::Logging
Definition
AggregateLogger.h:8
DotNetDupe::Extensions
Definition
IServiceCollection.h:8
DotNetDupe
Definition
IServiceCollection.h:7
DotNetDupe::Extensions::Logging::LoggerConfiguration
Encapsulates logging system configuration options.
Definition
LoggerConfiguration.h:26
Include
Extensions
Logging
LogManager.h
Generated by
1.18.0