Class FlowGraphLogger
- Namespace
- FlowGraph.Core.Diagnostics
- Assembly
- FlowGraph.Core.dll
Central static logger for FlowGraph diagnostics. Thread-safe and designed for high-performance logging with minimal overhead when disabled.
public static class FlowGraphLogger
- Inheritance
-
FlowGraphLogger
- Inherited Members
Properties
EnabledCategories
Gets or sets the enabled categories. Only messages matching these categories are logged.
public static LogCategory EnabledCategories { get; set; }
Property Value
IsEnabled
Gets or sets whether logging is enabled globally. When disabled, all logging calls are no-ops with minimal overhead.
public static bool IsEnabled { get; set; }
Property Value
MinimumLevel
Gets or sets the minimum log level. Messages below this level are ignored.
public static LogLevel MinimumLevel { get; set; }
Property Value
Sink
Gets the current log sink.
public static ILogSink Sink { get; }
Property Value
Methods
BackgroundRenderer(LogLevel, string, string?, object?)
Logs a background renderer message.
public static void BackgroundRenderer(LogLevel level, string message, string? source = null, object? properties = null)
Parameters
BeginScope(string)
Creates a correlation scope for tracking related log entries.
public static IDisposable BeginScope(string name)
Parameters
namestring
Returns
Configure(Action<LoggerConfiguration>)
Configures the logger with the specified settings.
public static void Configure(Action<LoggerConfiguration> configure)
Parameters
configureAction<LoggerConfiguration>
CustomRenderer(LogLevel, string, string?, object?)
Logs a custom renderer message.
public static void CustomRenderer(LogLevel level, string message, string? source = null, object? properties = null)
Parameters
Debug(LogCategory, string, string?, string?, string?, int)
Logs a debug message.
public static void Debug(LogCategory category, string message, string? source = null, string? memberName = null, string? filePath = null, int lineNumber = 0)
Parameters
DisableAll()
Disables all logging.
public static void DisableAll()
Edges(LogLevel, string, string?, object?)
Logs an edge-related message.
public static void Edges(LogLevel level, string message, string? source = null, object? properties = null)
Parameters
EnableAll(LogLevel)
Enables all logging at the specified level.
public static void EnableAll(LogLevel minimumLevel = LogLevel.Debug)
Parameters
minimumLevelLogLevel
Error(LogCategory, string, string?, Exception?, string?, string?, int)
Logs an error message.
public static void Error(LogCategory category, string message, string? source = null, Exception? exception = null, string? memberName = null, string? filePath = null, int lineNumber = 0)
Parameters
categoryLogCategorymessagestringsourcestringexceptionExceptionmemberNamestringfilePathstringlineNumberint
Info(LogCategory, string, string?, string?, string?, int)
Logs an informational message.
public static void Info(LogCategory category, string message, string? source = null, string? memberName = null, string? filePath = null, int lineNumber = 0)
Parameters
Input(LogLevel, string, string?, object?)
Logs an input-related message.
public static void Input(LogLevel level, string message, string? source = null, object? properties = null)
Parameters
IsLevelEnabled(LogLevel, LogCategory)
Checks if a message at the given level and category would be logged. Use this to avoid expensive message formatting when logging is disabled.
public static bool IsLevelEnabled(LogLevel level, LogCategory category)
Parameters
levelLogLevelcategoryLogCategory
Returns
Layout(LogLevel, string, string?, object?)
Logs a layout-related message.
public static void Layout(LogLevel level, string message, string? source = null, object? properties = null)
Parameters
Log(LogLevel, LogCategory, string, object, string?, string?, string?, int)
Logs a message with structured properties.
public static void Log(LogLevel level, LogCategory category, string message, object properties, string? source = null, string? memberName = null, string? filePath = null, int lineNumber = 0)
Parameters
levelLogLevelcategoryLogCategorymessagestringpropertiesobjectsourcestringmemberNamestringfilePathstringlineNumberint
Log(LogLevel, LogCategory, string, string?, Exception?, Dictionary<string, object?>?, string?, string?, int)
Logs a message at the specified level and category.
public static void Log(LogLevel level, LogCategory category, string message, string? source = null, Exception? exception = null, Dictionary<string, object?>? properties = null, string? memberName = null, string? filePath = null, int lineNumber = 0)
Parameters
levelLogLevelcategoryLogCategorymessagestringsourcestringexceptionExceptionpropertiesDictionary<string, object>memberNamestringfilePathstringlineNumberint
Nodes(LogLevel, string, string?, object?)
Logs a node-related message.
public static void Nodes(LogLevel level, string message, string? source = null, object? properties = null)
Parameters
Rendering(LogLevel, string, string?, object?)
Logs a rendering-related message.
public static void Rendering(LogLevel level, string message, string? source = null, object? properties = null)
Parameters
SetSink(ILogSink)
Sets the log sink directly.
public static void SetSink(ILogSink sink)
Parameters
sinkILogSink
TimeScope(LogCategory, string, string?, string?, string?, int)
Creates a timing scope that logs entry and exit with elapsed time.
public static IDisposable TimeScope(LogCategory category, string operationName, string? source = null, string? memberName = null, string? filePath = null, int lineNumber = 0)
Parameters
categoryLogCategoryoperationNamestringsourcestringmemberNamestringfilePathstringlineNumberint
Returns
Trace(LogCategory, string, string?, string?, string?, int)
Logs a trace message for fine-grained debugging.
[Conditional("DEBUG")]
public static void Trace(LogCategory category, string message, string? source = null, string? memberName = null, string? filePath = null, int lineNumber = 0)
Parameters
Viewport(LogLevel, string, string?, object?)
Logs a viewport-related message.
public static void Viewport(LogLevel level, string message, string? source = null, object? properties = null)
Parameters
Warn(LogCategory, string, string?, Exception?, string?, string?, int)
Logs a warning message.
public static void Warn(LogCategory category, string message, string? source = null, Exception? exception = null, string? memberName = null, string? filePath = null, int lineNumber = 0)