Crate mgba_log

source ·
Expand description

A logging implementation for mGBA.

Provides a logging implementation for the log crate for logging when compiling for the Game Boy Advance and running within the mGBA emulator.

mGBA supports logging at the following log levels using the associated logging macros. Every level provided by the log crate is supported except for Trace, as mGBA has no analog for the Trace log level, and this crate provides a macro for logging directly to Fatal.

LevelMacroNotes
Debuglog::debug!
Infolog::info!
Warnlog::warn!
Errorlog::error!
Fatalmgba_log::fatal!Not a standard log level. Only usable when using this logging implementation.

Compatibility

This logger uses memory mapped IO registers specific to the Game Boy Advance. It is therefore only safe to use this library when building to run on the Game Boy Advance or a Game Boy Advance emulator.

If this logger is attempted to be initialized when not running on mGBA, it will fail to initialize with an Error identifying the failure.

Macros

  • Logs a message at the fatal level.

Enums

  • An error occurring during initialization.

Functions

  • Initialize mGBA logging.