Crate galacta_logger[−][src]
Expand description
Simple logger crate
Usage
You can use logger without any initialization.
You may set “G_LOG_LEVEL” environment variable by LevelFilter
value.
/// These are logs without specified target or initializations(recommended)
use galacta_logger::{self,prelude::*};
gerror!("This is errror");
gwarn!("This is warning");
ginfo!("This is info");
gdebug!("This is debug");
gtrace!("This is trace");
You also can use logger with initialization.
use galacta_logger::{self,GalactaLogger,LevelFilter,prelude::*};
/// First initialize logger.
/// You may set "G_LOG_LEVEL" environment variable by [`LevelFilter`] value.
/// If environment variable is set, argument of init function will be ignored
GalactaLogger::init(LevelFilter::Trace);
/// These are logs with specified target(unrecommended)
error!("This is errror");
warn!(target: "target","This is warning");
info!("This is info");
debug!("This is debug");
trace!("This is trace");
Modules
prerule include macros.
Macros
macro for invoke debug level log without initialization and target
macro for invoke debug error log without initialization and target
macro for invoke info level log without initialization and target
macro for invoke trace level log without initialization and target
macro for invoke warn level log without initialization and target
Structs
Logger structure
Enums
Enum for setting max level of log