Table of Contents

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

LogCategory

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

bool

MinimumLevel

Gets or sets the minimum log level. Messages below this level are ignored.

public static LogLevel MinimumLevel { get; set; }

Property Value

LogLevel

Sink

Gets the current log sink.

public static ILogSink Sink { get; }

Property Value

ILogSink

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

level LogLevel
message string
source string
properties object

BeginScope(string)

Creates a correlation scope for tracking related log entries.

public static IDisposable BeginScope(string name)

Parameters

name string

Returns

IDisposable

Configure(Action<LoggerConfiguration>)

Configures the logger with the specified settings.

public static void Configure(Action<LoggerConfiguration> configure)

Parameters

configure Action<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

level LogLevel
message string
source string
properties object

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

category LogCategory
message string
source string
memberName string
filePath string
lineNumber int

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

level LogLevel
message string
source string
properties object

EnableAll(LogLevel)

Enables all logging at the specified level.

public static void EnableAll(LogLevel minimumLevel = LogLevel.Debug)

Parameters

minimumLevel LogLevel

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

category LogCategory
message string
source string
exception Exception
memberName string
filePath string
lineNumber int

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

category LogCategory
message string
source string
memberName string
filePath string
lineNumber int

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

level LogLevel
message string
source string
properties object

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

level LogLevel
category LogCategory

Returns

bool

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

level LogLevel
message string
source string
properties object

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

level LogLevel
category LogCategory
message string
properties object
source string
memberName string
filePath string
lineNumber int

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

level LogLevel
category LogCategory
message string
source string
exception Exception
properties Dictionary<string, object>
memberName string
filePath string
lineNumber int

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

level LogLevel
message string
source string
properties object

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

level LogLevel
message string
source string
properties object

SetSink(ILogSink)

Sets the log sink directly.

public static void SetSink(ILogSink sink)

Parameters

sink ILogSink

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

category LogCategory
operationName string
source string
memberName string
filePath string
lineNumber int

Returns

IDisposable

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

category LogCategory
message string
source string
memberName string
filePath string
lineNumber int

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

level LogLevel
message string
source string
properties object

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)

Parameters

category LogCategory
message string
source string
exception Exception
memberName string
filePath string
lineNumber int