mirror of
https://github.com/yewstack/yew.git
synced 2026-02-01 17:26:28 +00:00
Merge #230
230: Add logging r=DenisKolodin a=DenisKolodin Co-authored-by: Denis Kolodin <deniskolodin@gmail.com>
This commit is contained in:
commit
51141e9202
@ -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"
|
||||
|
||||
@ -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 = "../.." }
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
|
||||
@ -50,6 +50,8 @@
|
||||
|
||||
#[macro_use]
|
||||
extern crate failure;
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
extern crate http;
|
||||
extern crate serde;
|
||||
extern crate serde_json;
|
||||
|
||||
@ -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,)*);
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user