Struct glog::Flags [−][src]
pub struct Flags { pub colorlogtostderr: bool, pub minloglevel: Level, pub log_backtrace_at: Option<String>, pub logtostderr: bool, pub alsologtostderr: bool, pub log_dir: OsString, }
Expand description
The flag structure used to initialize glog.
The flags have the same name and defaults as in glog
but use Rust types where possible.
Example
This are the defaults for each flag:
use std::{env::temp_dir, ffi::OsString, path::PathBuf}; use log::*; use glog::Flags; let flags = Flags::default(); assert_eq!(flags.colorlogtostderr, false); assert_eq!(flags.minloglevel, Level::Info); assert!(flags.log_backtrace_at.is_none()); assert_eq!(flags.logtostderr, false); assert_eq!(flags.alsologtostderr, false); assert_eq!(flags.log_dir, [temp_dir(), PathBuf::from("")].iter().collect::<PathBuf>().into_os_string());
Fields
colorlogtostderr: bool
If logging to stderr try to colorize levels more severe than Info
minloglevel: Level
Minimum level (inclusive) that should be logged
log_backtrace_at: Option<String>
Optionally log a backtrace at filename:line
log invocation.
The log level has to be enabled for it to work.
Will be written in the log file with the lowest severity.
logtostderr: bool
Log to stderr instead of logfiles
alsologtostderr: bool
Log to stderr and logfiles
log_dir: OsString
Directory in which to store the log files
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Flags
impl UnwindSafe for Flags
Blanket Implementations
Mutably borrows from an owned value. Read more