2 releases

new 0.1.1 Apr 20, 2024
0.1.0 Mar 22, 2024

#285 in Debugging

Download history 87/week @ 2024-03-16 34/week @ 2024-03-23 13/week @ 2024-03-30 1/week @ 2024-04-06

135 downloads per month

MIT license

8KB
94 lines

psp-logger

A logger capable of outputting to the PSP's stdout and stderr.

This output can than be viewed using PSPLink

Usage

use psp_logger::{PspLogger, PspLoggerConfig, OutputStream};
use log::{trace, debug, info, warn, error};

// Configure logging to only allow messages with debug-level or above.
// Map debug and info to stdout, letting other levels use the default stderr.
let config = PspLoggerConfig::new(log::LevelFilter::Debug)
    .with_debug_stream(OutputStream::StdOut)
    .with_info_stream(OutputStream::StdOut);

let _ = psp_logger::PspLogger::init(config);

trace!("This will be filtered out.");
debug!("This will be logged to stdout.");
info!("This will also be logged to stdout");
warn!("This will be logged to stderr.");
error!("This will also be logged to stder.");


lib.rs:

psp-logger

A logger capable of outputting to the PSP's stdout and stderr.

This output can than be viewed using PSPLink

Usage

use psp_logger::{PspLogger, PspLoggerConfig, OutputStream};
use log::{trace, debug, info, warn, error};

// Configure logging to only allow messages with debug-level or above.
// Map debug and info to stdout, letting other levels use the default stderr.
let config = PspLoggerConfig::new(log::LevelFilter::Debug)
    .with_debug_stream(OutputStream::StdOut)
    .with_info_stream(OutputStream::StdOut);

let _ = psp_logger::PspLogger::init(config);

trace!("This will be filtered out.");
debug!("This will be logged to stdout.");
info!("This will also be logged to stdout");
warn!("This will be logged to stderr.");
error!("This will also be logged to stder.");

Dependencies

~3MB
~65K SLoC