mirror of
https://github.com/librespot-org/librespot.git
synced 2024-11-08 16:45:43 +00:00
commit
4e3576ba7c
3 changed files with 348 additions and 248 deletions
581
Cargo.lock
generated
581
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -34,7 +34,7 @@ path = "protocol"
|
|||
|
||||
[dependencies]
|
||||
base64 = "0.5.0"
|
||||
env_logger = "0.4.0"
|
||||
env_logger = "0.6.1"
|
||||
futures = "0.1.8"
|
||||
getopts = "0.2.14"
|
||||
hyper = "0.11.2"
|
||||
|
|
13
src/main.rs
13
src/main.rs
|
@ -14,7 +14,6 @@ extern crate sha1;
|
|||
extern crate hex;
|
||||
|
||||
use sha1::{Sha1, Digest};
|
||||
use env_logger::LogBuilder;
|
||||
use futures::sync::mpsc::UnboundedReceiver;
|
||||
use futures::{Async, Future, Poll, Stream};
|
||||
use std::env;
|
||||
|
@ -53,11 +52,11 @@ fn usage(program: &str, opts: &getopts::Options) -> String {
|
|||
}
|
||||
|
||||
fn setup_logging(verbose: bool) {
|
||||
let mut builder = LogBuilder::new();
|
||||
let mut builder = env_logger::Builder::new();
|
||||
match env::var("RUST_LOG") {
|
||||
Ok(config) => {
|
||||
builder.parse(&config);
|
||||
builder.init().unwrap();
|
||||
builder.parse_filters(&config);
|
||||
builder.init();
|
||||
|
||||
if verbose {
|
||||
warn!("`--verbose` flag overidden by `RUST_LOG` environment variable");
|
||||
|
@ -65,11 +64,11 @@ fn setup_logging(verbose: bool) {
|
|||
}
|
||||
Err(_) => {
|
||||
if verbose {
|
||||
builder.parse("mdns=info,librespot=trace");
|
||||
builder.parse_filters("mdns=info,librespot=trace");
|
||||
} else {
|
||||
builder.parse("mdns=info,librespot=info");
|
||||
builder.parse_filters("mdns=info,librespot=info");
|
||||
}
|
||||
builder.init().unwrap();
|
||||
builder.init();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue