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§
- prelude
- prerule include macros.
Macros§
- gdebug
- macro for invoke debug level log without initialization and target
- gerror
- macro for invoke debug error log without initialization and target
- ginfo
- macro for invoke info level log without initialization and target
- gtrace
- macro for invoke trace level log without initialization and target
- gwarn
- macro for invoke warn level log without initialization and target
Structs§
- Galacta
Logger - Logger structure
Enums§
- Level
Filter - Enum for setting max level of log An enum representing the available verbosity level filters of the logger.