Skip to content
Class

Logging ​

Mediabunny's central logging singleton. Use level to control how much is printed to the console, and subscribe to log events using on.

Having manual control over logging is useful for command-line applications where you want full say over the output.

Static methods ​

on() ​

ts
static on<K extends keyof LoggingEvents>(
	event: K,
	listener: (data: LoggingEvents[K]) => unknown,
	options?: EventListenerOptions,
): () => void;

Registers a listener for a log event. Returns a function that, when called, removes the listener again.

See LoggingEvents and EventListenerOptions.

Properties ​

level ​

ts
level: LogLevel;

The current log level. Defaults to LogLevel.Info.

Released under the Mozilla Public License 2.0.