Subclasses should implement this method to perform the formatting of the actual message content.
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
A simple layout, prefixing each message with the log level and the name of the logger.