Skip to main content

FlixelTeaVMLogConsole

View source

class

org.flixelgdx.backend.teavm.logging.FlixelTeaVMLogConsole

public final class FlixelTeaVMLogConsole

Routes FlixelLogConsoleSink output to the browser console with %c styling so log levels and locations read clearly in devtools (ANSI escapes from System.out are not used on web).

The native script also picks the right console method per level (so the browser's own filter pills for warnings and errors work as expected): console.log for DEBUG and INFO, console.warn for WARN, and console.error for ERROR.

Methods

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

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

Forwards one structured log to JavaScript. Matches FlixelLogConsoleSink#emit for use with Flixel.logConsoleSink = FlixelTeaVMLogConsole::emit.

Parameters:

NameDescription
levelThe log level to color and route on.
tagThe associated tag, may be empty.
messageThe body text of the log line.
simpleLocationThe short package/File.java:line: prefix for simple mode.
detailedFileThe detailed File.java:line string used in detailed mode.
methodLabelThe method label such as update().
timestampThe pre-formatted timestamp string.
detailedtrue to render in detailed mode (timestamp + tags + body).