230: Add logging r=DenisKolodin a=DenisKolodin



Co-authored-by: Denis Kolodin <deniskolodin@gmail.com>
This commit is contained in:
bors[bot] 2018-05-11 07:37:03 +00:00
commit 51141e9202
5 changed files with 14 additions and 17 deletions

View File

@ -13,6 +13,7 @@ description = "A framework for making client-side single-page apps"
[dependencies]
failure = "0.1"
log = "0.4"
http = "0.1"
serde = "1"
serde_json = "1"

View File

@ -4,6 +4,8 @@ version = "0.1.0"
authors = ["Denis Kolodin <deniskolodin@gmail.com>", "Limira"]
[dependencies]
log = "0.4"
web_logger = "0.1"
strum = "0.9"
strum_macros = "0.9"
yew = { path = "../.." }

View File

@ -1,9 +1,11 @@
#![recursion_limit="128"]
#[macro_use]
extern crate log;
extern crate web_logger;
extern crate strum;
#[macro_use]
extern crate strum_macros;
#[macro_use]
extern crate yew;
extern crate counter;
@ -287,7 +289,10 @@ impl Scene {
}
fn main() {
web_logger::init();
trace!("Initializing yew...");
yew::initialize();
trace!("Creating a context...");
let context = Context {
console: ConsoleService::new(),
storage: StorageService::new(Area::Local),
@ -300,8 +305,11 @@ fn main() {
timeout: TimeoutService::new(),
two_apps: two_apps::Context::new(),
};
trace!("Creating an application instance...");
let app: App<_, Scene> = App::new(context);
trace!("Mount the App to the body of the page...");
app.mount_to_body();
trace!("Run");
yew::run_loop();
}

View File

@ -50,6 +50,8 @@
#[macro_use]
extern crate failure;
#[macro_use]
extern crate log;
extern crate http;
extern crate serde;
extern crate serde_json;

View File

@ -286,19 +286,3 @@ pub fn child_to_parent<CTX, COMP: Component<CTX>>(
panic!("redundant closing tag: {:?}", endtag);
}
}
#[macro_export]
macro_rules! debug {
($($e:expr),*) => {
if cfg!(debug) {
println!($($e,)*);
}
};
}
#[macro_export]
macro_rules! warn {
($($e:expr),*) => {
eprintln!($($e,)*);
};
}