nocash_gba_log

Crates.ionocash_gba_log
lib.rsnocash_gba_log
version0.1.0
sourcesrc
created_at2023-09-16 07:22:29.575545
updated_at2023-09-16 07:22:29.575545
descriptionA logging implementation for no$gba.
homepage
repositoryhttps://github.com/Anders429/nocash_gba_log
max_upload_size
id974206
size21,995
Anders Evensen (Anders429)

documentation

README

nocash_gba_log

crates.io docs.rs License

A logging implementation for no$gba.

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

Usage

In libraries

nocash_gba_log should be used in binaries only. Libraries should instead use the logging facade provided by the log crate directly.

In binaries

When logging in a binary, only one logger may be enabled. Therefore, nocash_gba_log cannot be used alongside any other logging implementations.

Installation

Add nocash_gba_log as a dependency in your Cargo.toml:

[dependencies]
nocash_gba_log = "0.1.0"

Then call init() early in your binary. Any records logged before initialization will be silently dropped.

fn main() {
    nocash_gba_log::init().expect("unable to initialize no$gba logger");

    log::info!("Hello, world!");
}

Note that you may want to handle the returned Error message from init() more robustly, unless you only want your project to be run in no$gba.

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 no$gba, it will fail to initialize with an Error identifying the failure.

License

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Commit count: 15

cargo fmt