Merge pull request #144 from SimonPersson/improve_printing

Improve log strings and never log to stdout.
This commit is contained in:
Paul Lietar 2017-01-06 16:02:38 +01:00 committed by GitHub
commit a8aea3e8de
2 changed files with 3 additions and 3 deletions

View file

@ -6,7 +6,7 @@ pub struct AlsaSink(Option<PCM>, String);
impl Open for AlsaSink { impl Open for AlsaSink {
fn open(device: Option<&str>) -> AlsaSink { fn open(device: Option<&str>) -> AlsaSink {
println!("Using alsa sink"); info!("Using alsa sink");
let name = device.unwrap_or("default").to_string(); let name = device.unwrap_or("default").to_string();

View file

@ -180,12 +180,12 @@ fn find_available_alternative<'a>(session: &Session, track: &'a Track) -> Option
fn load_track(session: &Session, track_id: SpotifyId) -> Option<vorbis::Decoder<Subfile<AudioDecrypt<Box<ReadSeek>>>>> { fn load_track(session: &Session, track_id: SpotifyId) -> Option<vorbis::Decoder<Subfile<AudioDecrypt<Box<ReadSeek>>>>> {
let track = session.metadata::<Track>(track_id).await().unwrap(); let track = session.metadata::<Track>(track_id).await().unwrap();
info!("Loading track {:?}", track.name); info!("Loading track \"{}\"", track.name);
let track = match find_available_alternative(session, &track) { let track = match find_available_alternative(session, &track) {
Some(track) => track, Some(track) => track,
None => { None => {
warn!("Track {:?} is not available", track.name); warn!("Track \"{}\" is not available", track.name);
return None; return None;
} }
}; };