Skip to content
Dan M edited this page Mar 31, 2022 · 6 revisions

Log contains an extended console logger with colours and varying log levels.


API

Enums

Level

The various levels that the logger can log at. Logs will be coloured and include an icon based on the level.

Value Colour Icon
info Blue Icons.lightbulb
warning Yellow Icons.warning
error Red Icons.error
debug Green Icons.bug_report

Static Methods

static void showLogger(BuildContext context)

Brings up a page in app that shows the console output.

Constructor

Log(String name, {Level level, bool colors})

Creates a new Log with name. level sets the initial log level of the Log, and setting colors to false disables colours. level defaults to Level.info and colors defaults to true.

Methods

void log(dynamic message, [Error? error, StackTrace? stackTrace])

Logs message to the console, at the currently set Level. Optional errors and stacktraces can be included with error and stackTrace

void logAt(Level level, dynamic message, [Error? error, StackTrace? stackTrace])

Same as log, but you can set the Level through level.

void info(dynamic message, [Error? error, StackTrace? stackTrace])

Getters

Clone this wiki locally