Skip to main content

FlixelLogConsoleSink

View source

interface

org.flixelgdx.logging.FlixelLogConsoleSink

public interface FlixelLogConsoleSink

Optional sink for a single structured log line to the host console. Used on platforms where System.out is not appropriate or where ANSI colors from the default path do not render (for example, browser devtools with styled console.log).

Assign to Flixel.logConsoleSink before Flixel.initialize from the platform launcher. When set, the logger calls this instead of writing ANSI text to standard output; file logging and in-game log listeners are unchanged.

Methods

emit(FlixelLogLevel, String, String, String, String, String, String, boolean)

public void emit(FlixelLogLevel level, String tag, String message, String simpleLocation, String detailedFile, String methodLabel, String timestamp, boolean detailed)

Emits one log line. Arguments mirror the data used to build the normal console and file lines, without ANSI codes.

Parameters:

NameDescription
levelThe log level.
tagThe tag, never null but may be empty.
messageThe message body.
simpleLocationIn simple log mode, the location prefix such as mypkg/MyClass.java:42:; when the call site is unknown, a placeholder (for example, unknown:0:).
detailedFileShort file/line ID used in detailed mode, such as MyClass.java:42.
methodLabelMethod name with parentheses, for example, update().
timestampThe formatted timestamp used in detailed mode.
detailedtrue if FlixelLogMode.DETAILED formatting applies; otherwise simple mode.