|
DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
|
Classes | |
| class | AggregateLogger |
| Composite ILogger implementation that fans out log messages to multiple underlying loggers. More... | |
| class | ConsoleLogger |
| Implementation of ILogger that outputs formatted logs to standard output. More... | |
| class | ConsoleLoggerProvider |
| Provider that creates ConsoleLogger instances configured with shared settings. More... | |
| class | FileLogger |
| Implementation of ILogger that appends formatted logs to a file on disk. More... | |
| struct | FileLoggerContext |
| class | FileLoggerProvider |
| Provider that creates FileLogger instances sharing a file handle and rotation context. More... | |
| struct | FileRolloverConfig |
| Configuration settings for file rotation and archival. [Microsoft.Extensions.Logging]. More... | |
| class | ILogger |
| Represents a type used to perform logging. More... | |
| class | ILoggerFactory |
| Represents a type used to configure the logging system and create instances of ILogger. More... | |
| class | ILoggerOf |
| A generic interface for logging where the category name is derived from the specified type name. More... | |
| class | ILoggerProvider |
| Represents a type that can create instances of ILogger. More... | |
| class | Logger |
| Delegates logging to a wrapped ILogger instance where category is based on T. More... | |
| class | LoggerBase |
| Abstract base class providing common formatting and level filtering for loggers. More... | |
| struct | LoggerConfiguration |
| Encapsulates logging system configuration options. More... | |
| class | LoggerFactory |
| Factory class used to configure logging providers and create ILogger instances. More... | |
| class | LoggerTextWriter |
| Adapter that routes System::IO::TextWriter stream writes into an ILogger destination. More... | |
| class | LogManager |
| Central thread-safe static registry and entry point for application logging. More... | |
Enumerations | |
| enum class | LogLevel { Trace = 0 , Debug = 1 , Information = 2 , Warning = 3 , Error = 4 , Critical = 5 , None = 6 } |
| Defines logging severity levels. More... | |
|
strong |
Defines logging severity levels.
Modeled after Microsoft.Extensions.Logging.LogLevel. [Microsoft.Extensions.Logging]
|
static |
Guard: Skip if dictionary is empty.
Serialize dictionary entries into JSON properties object.
Definition at line 124 of file LoggerBase.cpp.
References AddJsonLogProperties(), DotNetDupe::System::Collections::Generic::Dictionary< TKey, TValue >::GetCount(), DotNetDupe::System::Collections::Generic::Dictionary< TKey, TValue >::GetKeys(), DotNetDupe::System::Text::Json::Object, DotNetDupe::System::Text::Json::JsonElement::SetProperty(), and DotNetDupe::System::Collections::Generic::Dictionary< TKey, TValue >::TryGetValue().
Referenced by AddJsonLogProperties(), and BuildJsonLog().
|
static |
Construct root JSON event object with standard diagnostic fields.
Append structured property attributes and return serialized JSON.
Definition at line 139 of file LoggerBase.cpp.
References AddJsonLogProperties(), BuildJsonLog(), DotNetDupe::System::Text::Json::Object, DotNetDupe::System::Text::Json::JsonElement::SetProperty(), and DotNetDupe::System::Text::Json::JsonElement::ToString().
Referenced by BuildJsonLog(), and DotNetDupe::Extensions::Logging::LoggerBase::BuildLogMessage().
|
static |
Guard: Skip rollover if disabled or file is not open.
Trigger rollover if write exceeds maximum configured file size.
Definition at line 50 of file FileLogger.cpp.
References CheckAndRollover(), DotNetDupe::Extensions::Logging::FileRolloverConfig::EnableRollover, DotNetDupe::Extensions::Logging::FileLoggerContext::fileStream, DotNetDupe::Extensions::Logging::FileRolloverConfig::MaxFileSizeInBytes, PerformFileRollover(), and DotNetDupe::Extensions::Logging::LoggerConfiguration::Rollover.
Referenced by CheckAndRollover(), and DotNetDupe::Extensions::Logging::FileLogger::Log().
| LogLevel DotNetDupe::Extensions::Logging::ParseLogLevel | ( | const DotNetDupe::System::String & | str | ) |
Parses a case-insensitive string into a corresponding LogLevel enumeration value.
| str | String name of the log level (e.g., "Information", "Debug", "Error"). |
Normalize input string to lowercase for case-insensitive comparison.
Lookup level against known string names and numeric codes (CCN <= 4).
Throw custom library exception if input is invalid.
Definition at line 160 of file LoggerConfiguration.cpp.
References Critical, Debug, Error, Information, None, ParseLogLevel(), DotNetDupe::System::String::ToLower(), Trace, and Warning.
Referenced by ParseLogLevel().
|
static |
Close current file handle before rotating files on disk.
Shift existing backup archives (.N to .N+1).
Rename active log file to first backup (.1).
Re-open active log file in append mode.
Definition at line 28 of file FileLogger.cpp.
References DotNetDupe::Extensions::Logging::LoggerConfiguration::FilePath, DotNetDupe::Extensions::Logging::FileLoggerContext::fileStream, DotNetDupe::System::String::GetRawString(), DotNetDupe::Extensions::Logging::FileRolloverConfig::MaxBackupFiles, PerformFileRollover(), and DotNetDupe::Extensions::Logging::LoggerConfiguration::Rollover.
Referenced by CheckAndRollover(), and PerformFileRollover().
|
static |
Iterate dictionary keys and interpolate matching placeholders.
Definition at line 76 of file LoggerBase.cpp.
References DotNetDupe::System::Collections::Generic::Dictionary< TKey, TValue >::GetKeys(), DotNetDupe::System::String::GetRawString(), ReplaceDynamicPropertyTokens(), ReplaceToken(), and DotNetDupe::System::Collections::Generic::Dictionary< TKey, TValue >::TryGetValue().
Referenced by DotNetDupe::Extensions::Logging::LoggerBase::BuildLogMessage(), and ReplaceDynamicPropertyTokens().
|
static |
Replace all occurrences of placeholder token with replacement text.
Definition at line 66 of file LoggerBase.cpp.
References ReplaceToken().
Referenced by DotNetDupe::Extensions::Logging::LoggerBase::FormatLogLine(), ReplaceDynamicPropertyTokens(), and ReplaceToken().
|
static |
Fallback to default directory if path is unspecified.
Resolve full normalized path.
Ensure target parent directory exists on disk.
Return normalized full path.
Definition at line 19 of file FileLoggerProvider.cpp.
References DotNetDupe::System::IO::Directory::CreateDirectory(), DotNetDupe::System::IO::Directory::Exists(), DotNetDupe::System::IO::Path::GetDirectoryName(), DotNetDupe::System::IO::Path::GetFullPath(), DotNetDupe::System::String::IsEmpty(), and ResolveAndPrepareLogPath().
Referenced by DotNetDupe::Extensions::Logging::FileLoggerProvider::FileLoggerProvider(), DotNetDupe::Extensions::Logging::FileLoggerProvider::FileLoggerProvider(), and ResolveAndPrepareLogPath().
|
static |
Guard: Return empty if no properties exist.
Append unused properties in key: value format.
Definition at line 91 of file LoggerBase.cpp.
References DotNetDupe::System::Collections::Generic::Dictionary< TKey, TValue >::GetCount(), DotNetDupe::System::Collections::Generic::Dictionary< TKey, TValue >::GetKeys(), DotNetDupe::System::String::GetRawString(), SerializeUnusedPropertiesText(), and DotNetDupe::System::Collections::Generic::Dictionary< TKey, TValue >::TryGetValue().
Referenced by DotNetDupe::Extensions::Logging::LoggerBase::BuildLogMessage(), and SerializeUnusedPropertiesText().