example(dialog): switch logger to fix build
This commit is contained in:
parent
1c4ab75814
commit
908f30a571
1 changed files with 17 additions and 1 deletions
|
|
@ -9,9 +9,25 @@ use cosmic_files::dialog::{
|
||||||
Dialog, DialogChoice, DialogChoiceOption, DialogFilter, DialogFilterPattern, DialogKind,
|
Dialog, DialogChoice, DialogChoiceOption, DialogFilter, DialogFilterPattern, DialogKind,
|
||||||
DialogMessage, DialogResult, DialogSettings,
|
DialogMessage, DialogResult, DialogSettings,
|
||||||
};
|
};
|
||||||
|
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
|
||||||
|
|
||||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("warn")).init();
|
let log_format = tracing_subscriber::fmt::format()
|
||||||
|
.pretty()
|
||||||
|
.without_time()
|
||||||
|
.with_line_number(true)
|
||||||
|
.with_file(true)
|
||||||
|
.with_target(false)
|
||||||
|
.with_thread_names(true);
|
||||||
|
|
||||||
|
let log_layer = tracing_subscriber::fmt::Layer::default()
|
||||||
|
.with_writer(std::io::stderr)
|
||||||
|
.event_format(log_format);
|
||||||
|
|
||||||
|
tracing_subscriber::registry()
|
||||||
|
.with(tracing_subscriber::EnvFilter::from_env("RUST_LOG"))
|
||||||
|
.with(log_layer)
|
||||||
|
.init();
|
||||||
|
|
||||||
let settings = Settings::default();
|
let settings = Settings::default();
|
||||||
app::run::<App>(settings, ())?;
|
app::run::<App>(settings, ())?;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue