Table of Contents

Class ConsoleFormatter

Namespace
FishMMO.Logging
Assembly
FishMMO-Logger.dll

Implements IConsoleFormatter to handle the specific formatting and coloring of log entries for System.Console output.

public class ConsoleFormatter : IConsoleFormatter
Inheritance
ConsoleFormatter
Implements
Inherited Members

Methods

WriteColoredParts(LogLevel, string, int, params (string color, string text)[])

Writes a message to the console composed of multiple colored parts.

public void WriteColoredParts(LogLevel level, string source, int columnWidth = 0, params (string color, string text)[] parts)

Parameters

level LogLevel

The log level for this message (used for indentation/context).

source string

The source of the log message.

columnWidth int

Optional. The minimum width for each text segment. Text will be padded if shorter. Use 0 or negative for no padding.

parts (string color, string text)[]

An array of tuples, where each tuple contains a color (hex or named) and the text for that part.

WriteStructuredLog(LogEntry)

Writes a structured log entry to the console. This method performs synchronous console output and handles basic colorization.

public void WriteStructuredLog(LogEntry entry)

Parameters

entry LogEntry

The log entry to format and write.