Class GridForgeLogger
- Namespace
- GridForge
- Assembly
- GridForge.dll
Provides a configurable logging system for GridForge with support for log levels, formatting, and file output.
public static class GridForgeLogger
- Inheritance
-
GridForgeLogger
- Inherited Members
Properties
Channel
Gets the diagnostic channel used by GridForge logging.
public static DiagnosticChannel Channel { get; }
Property Value
- DiagnosticChannel
CustomFormatter
Gets or sets the formatter used to transform log arguments into a final log entry. Assigning null restores DefaultLogFormatter(DiagnosticLevel, string, string).
public static Func<DiagnosticLevel, string, string, string> CustomFormatter { get; set; }
Property Value
DebugChannel
Gets the diagnostic channel used for verbose debug diagnostics.
public static DiagnosticChannel DebugChannel { get; }
Property Value
- DiagnosticChannel
EnableDebugLogging
Gets or sets a value indicating whether verbose debug diagnostics should be emitted.
public static bool EnableDebugLogging { get; set; }
Property Value
LogFilePath
Gets or sets the file path for logging. If null, file logging is disabled.
public static string? LogFilePath { get; set; }
Property Value
LogHandler
Gets or sets the delegate used to write formatted log messages. Assigning null restores DefaultLogHandler(DiagnosticLevel, string, string).
public static Action<DiagnosticLevel, string, string> LogHandler { get; set; }
Property Value
MinimumLevel
Gets or sets the minimum log level required for messages to be logged.
public static DiagnosticLevel MinimumLevel { get; set; }
Property Value
- DiagnosticLevel
Methods
DefaultLogFormatter(DiagnosticLevel, string, string)
The default log formatter that formats log messages with timestamp, log level, and source information.
public static string DefaultLogFormatter(DiagnosticLevel level, string message, string source)
Parameters
levelDiagnosticLevelThe severity level of the log message.
messagestringThe log message.
sourcestringThe source of the log message.
Returns
- string
A formatted log entry as a string.
DefaultLogHandler(DiagnosticLevel, string, string)
The default handler for logging messages, writing them to the console and optionally to a file.
public static void DefaultLogHandler(DiagnosticLevel level, string message, string source)
Parameters
levelDiagnosticLevelThe severity level of the log message.
messagestringThe log message.
sourcestringThe source of the log message.
IsEnabled(DiagnosticLevel)
Determines whether diagnostics at the specified level are currently enabled.
public static bool IsEnabled(DiagnosticLevel level)
Parameters
levelDiagnosticLevelThe diagnostic level to evaluate.