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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.