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

Replace some more println with log

This commit is contained in:
Marcus Thiesen 2016-03-24 10:31:33 +01:00
parent e08ed545ee
commit b0ea636179
7 changed files with 16 additions and 13 deletions

View file

@ -2,6 +2,8 @@ extern crate getopts;
extern crate librespot;
extern crate rpassword;
extern crate env_logger;
#[macro_use]
extern crate log;
use rpassword::read_password;
use std::clone::Clone;
@ -34,12 +36,12 @@ 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::set_var(rust_log, "debug")
}
env_logger::init().unwrap();
println!("librespot {} ({}). Built on {}.",
info!("librespot {} ({}). Built on {}.",
version::short_sha(),
version::commit_date(),
version::short_now());
@ -150,7 +152,7 @@ fn main() {
}).or(stored_credentials)
.or_else(|| {
if cfg!(feature = "discovery") {
println!("No username provided and no stored credentials, starting discovery ...");
info!("No username provided and no stored credentials, starting discovery ...");
Some(discovery_login(&session.config().device_name,
session.device_id()).unwrap())
} else {