[][src]Function stackdriver_logger_kv::init_with

pub fn init_with(service: Option<Service>, report_location: bool)

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 !");