Function stackdriver_logger::init_with
source · Expand description
Initialize the logger manually.
Usage
With everything manually specified :
use log::info;
use stackdriver_logger::Service;
let params = Service {
name: "My Service".to_owned(),
version: "2.3.1".to_owned(),
};
stackdriver_logger::init_with(Some(params), true);
info!("We're all set here !");
You can also pass a None
instead of Some(Service{ ... })
and define the SERVICE_NAME
and SERVICE_VERSION
env variables :
use log::info;
stackdriver_logger::init_with(None, false);
info!("Make sur you don't forget the env variables !");