You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
963 B
56 lines
963 B
|
|
#![cfg_attr(debug_assertions, allow(dead_code))]
|
|
|
|
#[macro_use] extern crate tracing;
|
|
|
|
#[allow(unused_imports)]
|
|
use color_eyre::{
|
|
eyre::{
|
|
self,
|
|
eyre,
|
|
WrapErr,
|
|
},
|
|
SectionExt,
|
|
Help,
|
|
};
|
|
|
|
#[macro_use] mod ext; use ext::*;
|
|
mod loli;
|
|
|
|
/// Initialise panic, trace and error handles.
|
|
fn initialise() -> eyre::Result<()>
|
|
{
|
|
fn install_tracing()
|
|
{
|
|
//! Install spantrace handling
|
|
|
|
use tracing_error::ErrorLayer;
|
|
use tracing_subscriber::prelude::*;
|
|
use tracing_subscriber::{fmt, EnvFilter};
|
|
|
|
let fmt_layer = fmt::layer().with_target(false);
|
|
let filter_layer = EnvFilter::try_from_default_env()
|
|
.or_else(|_| EnvFilter::try_new("info"))
|
|
.unwrap();
|
|
|
|
tracing_subscriber::registry()
|
|
.with(filter_layer)
|
|
.with(fmt_layer)
|
|
.with(ErrorLayer::default())
|
|
.init();
|
|
}
|
|
|
|
install_tracing();
|
|
color_eyre::install()?;
|
|
|
|
Ok(())
|
|
}
|
|
|
|
#[instrument]
|
|
fn main() -> eyre::Result<()> {
|
|
initialise()?;
|
|
|
|
Ok(())
|
|
}
|
|
|