2个版本
0.1.1 | 2024年4月20日 |
---|---|
0.1.0 | 2024年3月22日 |
#331 in 调试
8KB
94 行
psp-logger
能够输出到PSP的stdout和stderr的日志记录器。
此输出可以使用 PSPLink 查看
用法
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
能够输出到PSP的stdout和stderr的日志记录器。
此输出可以使用 PSPLink 查看
用法
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.");
依赖项
~2.5MB
~48K SLoC