1
0
Fork 0
mirror of https://github.com/librespot-org/librespot.git synced 2025-10-05 02:39:53 +02:00

Use log crate instead of println

Allows more granular control over what gets logged to the console.
This commit is contained in:
Tor Arne Vestbø 2015-08-25 23:51:49 +02:00 committed by Marcus Thiesen
parent fcd35564df
commit e08ed545ee
7 changed files with 27 additions and 3 deletions

View file

@ -1,6 +1,7 @@
extern crate getopts;
extern crate librespot;
extern crate rpassword;
extern crate env_logger;
use rpassword::read_password;
use std::clone::Clone;
@ -8,6 +9,7 @@ use std::fs::File;
use std::io::{stdout, Read, Write};
use std::path::PathBuf;
use std::thread;
use std::env;
use librespot::audio_backend::BACKENDS;
use librespot::authentication::{Credentials, facebook_login, discovery_login};
@ -30,6 +32,13 @@ static APPKEY: Option<&'static [u8]> = Some(include_bytes!(concat!(env!("CARGO_M
static APPKEY: Option<&'static [u8]> = None;
fn main() {
let rust_log = "RUST_LOG";
if let Err(_) = env::var(rust_log) {
env::set_var(rust_log, "info")
}
env_logger::init().unwrap();
println!("librespot {} ({}). Built on {}.",
version::short_sha(),
version::commit_date(),