LayoutSimple

A simple layout, prefixing each message with the log level and the name of the logger.

Members

Functions

format
void format(LogEvent event, FormatterSink dg)

Subclasses should implement this method to perform the formatting of the actual message content.

Inherited Members

From Layout

FormatterSink
alias FormatterSink = .FormatterSink

Convenience alias for implementing classes

format
void format(LogEvent event, FormatterSink sink)

Format the provided event to the sink using this layout

Examples

import ocean.util.log.layout.LayoutSimple;
import ocean.util.log.Logger;
import ocean.util.log.AppendConsole;


Log.root.clear;
Log.root.add(new AppendConsole(new LayoutSimple));

auto logger = Log.lookup("Example");

logger.trace("Trace example");
logger.error("Error example");
logger.fatal("Fatal example");

Produced output:

Trace [Example] - Trace example
Error [Example] - Error example
Fatal [Example] - Fatal example

Meta