migrations
This commit is contained in:
parent
d1b0670d71
commit
f2b07c9f30
57 changed files with 2970 additions and 1 deletions
|
|
@ -0,0 +1 @@
|
|||
https://wasm-bindgen.github.io/wasm-bindgen/?search=logging
|
||||
46
20-dev/00-rust/wasm rust (frontend dioxus leptos)/logger.md
Normal file
46
20-dev/00-rust/wasm rust (frontend dioxus leptos)/logger.md
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
```rust
|
||||
use dioxus::prelude::*;
|
||||
use dioxus_logger::tracing::{Level, info};
|
||||
|
||||
fn main() {
|
||||
dioxus_logger::init(Level::INFO).expect("logger failed to init");
|
||||
dioxus::launch(App);
|
||||
}
|
||||
|
||||
#[component]
|
||||
fn App() -> Element {
|
||||
info!("App rendered");
|
||||
rsx! {
|
||||
p { "hi" }
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```rust
|
||||
use dioxus::prelude::*;
|
||||
use dioxus::logger::tracing::{Level, info};
|
||||
|
||||
fn main() {
|
||||
dioxus::logger::init(Level::INFO).expect("logger failed to init");
|
||||
dioxus::launch(App);
|
||||
}
|
||||
|
||||
#[component]
|
||||
fn App() -> Element {
|
||||
info!("App rendered");
|
||||
rsx! {
|
||||
p { "hi" }
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```rust
|
||||
fn main() {
|
||||
// Включает стандартный форматер с временем в UTC
|
||||
tracing_subscriber::fmt::init();
|
||||
|
||||
tracing::info!("Это сообщение будет с временной меткой.");
|
||||
}
|
||||
```
|
||||
|
||||
https://crates.io/crates/dioxus-logger
|
||||
Loading…
Add table
Add a link
Reference in a new issue