backend: Add simple custom logger

This commit is contained in:
Elias Projahn 2021-04-26 00:33:25 +02:00
parent 0d06fb3a31
commit aa2fb7ec08
5 changed files with 70 additions and 5 deletions

View file

@ -20,6 +20,8 @@ pub use error::*;
pub mod library;
pub use library::*;
mod logger;
pub mod player;
pub use player::*;
@ -70,8 +72,11 @@ pub struct Backend {
impl Backend {
/// Create a new backend initerface. The user interface should subscribe to the state stream
/// and call init() afterwards.
/// and call init() afterwards. There may be only one backend for a process and this method
/// may only be called exactly once. Otherwise it will panic.
pub fn new() -> Self {
logger::register();
let (state_sender, _) = broadcast::channel(1024);
let (library_updated_sender, _) = broadcast::channel(1024);