logging: Move all facilities to one file

This commit is contained in:
Dorota Czaplejewicz
2019-12-16 19:15:40 +00:00
parent 1237537005
commit e2b89e85f7
6 changed files with 50 additions and 42 deletions

View File

@ -19,17 +19,17 @@ use ::keyboard::{
};
use ::layout;
use ::layout::ArrangementKind;
use ::logging::PrintWarnings;
use ::resources;
use ::util::c::as_str;
use ::util::hash_map_map;
use ::xdg;
// traits, derives
use serde::Deserialize;
use std::io::BufReader;
use std::iter::FromIterator;
use serde::Deserialize;
use util::WarningHandler;
use ::logging::WarningHandler;
/// Gathers stuff defined in C or called by C
pub mod c {
@ -152,14 +152,6 @@ fn list_layout_sources(
ret
}
struct PrintWarnings;
impl WarningHandler for PrintWarnings {
fn handle(&mut self, warning: &str) {
println!("{}", warning);
}
}
fn load_layout_data(source: DataSource)
-> Result<::layout::LayoutData, LoadError>
{
@ -672,14 +664,7 @@ mod tests {
use super::*;
use std::error::Error as ErrorTrait;
struct PanicWarn;
impl WarningHandler for PanicWarn {
fn handle(&mut self, warning: &str) {
panic!("{}", warning);
}
}
use ::logging::PanicWarn;
#[test]
fn test_parse_path() {