add event handling to logger
This commit is contained in:
parent
539971dd05
commit
85de24f178
6 changed files with 331 additions and 49 deletions
238
packages/backend/Cargo.lock
generated
238
packages/backend/Cargo.lock
generated
|
@ -2,6 +2,15 @@
|
|||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "android_system_properties"
|
||||
version = "0.1.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311"
|
||||
dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "anyhow"
|
||||
version = "1.0.71"
|
||||
|
@ -96,18 +105,45 @@ version = "1.3.2"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
||||
|
||||
[[package]]
|
||||
name = "bumpalo"
|
||||
version = "3.12.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3c6ed94e98ecff0c12dd1b04c15ec0d7d9458ca8fe806cea6f12954efe74c63b"
|
||||
|
||||
[[package]]
|
||||
name = "bytes"
|
||||
version = "1.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be"
|
||||
|
||||
[[package]]
|
||||
name = "cc"
|
||||
version = "1.0.79"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f"
|
||||
|
||||
[[package]]
|
||||
name = "cfg-if"
|
||||
version = "1.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||
|
||||
[[package]]
|
||||
name = "chrono"
|
||||
version = "0.4.24"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b"
|
||||
dependencies = [
|
||||
"iana-time-zone",
|
||||
"js-sys",
|
||||
"num-integer",
|
||||
"num-traits",
|
||||
"time",
|
||||
"wasm-bindgen",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "config"
|
||||
version = "0.1.0"
|
||||
|
@ -119,6 +155,31 @@ dependencies = [
|
|||
"url",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "console"
|
||||
version = "0.15.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c3d79fbe8970a77e3e34151cc13d3b3e248aa0faaecb9f6091fa07ebefe5ad60"
|
||||
dependencies = [
|
||||
"encode_unicode",
|
||||
"lazy_static",
|
||||
"libc",
|
||||
"unicode-width",
|
||||
"windows-sys 0.42.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "core-foundation-sys"
|
||||
version = "0.8.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa"
|
||||
|
||||
[[package]]
|
||||
name = "encode_unicode"
|
||||
version = "0.3.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f"
|
||||
|
||||
[[package]]
|
||||
name = "fnv"
|
||||
version = "1.0.7"
|
||||
|
@ -239,6 +300,29 @@ dependencies = [
|
|||
"want",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "iana-time-zone"
|
||||
version = "0.1.56"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0722cd7114b7de04316e7ea5456a0bbb20e4adb46fd27a3697adb812cff0f37c"
|
||||
dependencies = [
|
||||
"android_system_properties",
|
||||
"core-foundation-sys",
|
||||
"iana-time-zone-haiku",
|
||||
"js-sys",
|
||||
"wasm-bindgen",
|
||||
"windows",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "iana-time-zone-haiku"
|
||||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f"
|
||||
dependencies = [
|
||||
"cc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "idna"
|
||||
version = "0.3.0"
|
||||
|
@ -265,6 +349,15 @@ version = "1.0.6"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6"
|
||||
|
||||
[[package]]
|
||||
name = "js-sys"
|
||||
version = "0.3.63"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790"
|
||||
dependencies = [
|
||||
"wasm-bindgen",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "lazy_static"
|
||||
version = "1.4.0"
|
||||
|
@ -300,8 +393,9 @@ dependencies = [
|
|||
name = "logging"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"config",
|
||||
"termcolor",
|
||||
"console",
|
||||
"thiserror",
|
||||
"tracing",
|
||||
"tracing-subscriber",
|
||||
|
@ -341,7 +435,7 @@ checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9"
|
|||
dependencies = [
|
||||
"libc",
|
||||
"log",
|
||||
"wasi",
|
||||
"wasi 0.11.0+wasi-snapshot-preview1",
|
||||
"windows-sys 0.45.0",
|
||||
]
|
||||
|
||||
|
@ -355,6 +449,25 @@ dependencies = [
|
|||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-integer"
|
||||
version = "0.1.45"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"num-traits",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-traits"
|
||||
version = "0.2.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num_cpus"
|
||||
version = "1.15.0"
|
||||
|
@ -559,8 +672,10 @@ dependencies = [
|
|||
"anyhow",
|
||||
"axum",
|
||||
"config",
|
||||
"logging",
|
||||
"macros",
|
||||
"tokio",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -614,15 +729,6 @@ version = "0.1.2"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160"
|
||||
|
||||
[[package]]
|
||||
name = "termcolor"
|
||||
version = "1.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6"
|
||||
dependencies = [
|
||||
"winapi-util",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thiserror"
|
||||
version = "1.0.40"
|
||||
|
@ -653,6 +759,17 @@ dependencies = [
|
|||
"once_cell",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "time"
|
||||
version = "0.1.45"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"wasi 0.10.0+wasi-snapshot-preview1",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tinyvec"
|
||||
version = "1.6.0"
|
||||
|
@ -812,6 +929,12 @@ dependencies = [
|
|||
"tinyvec",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "unicode-width"
|
||||
version = "0.1.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b"
|
||||
|
||||
[[package]]
|
||||
name = "unsafe-libyaml"
|
||||
version = "0.2.8"
|
||||
|
@ -845,12 +968,72 @@ dependencies = [
|
|||
"try-lock",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasi"
|
||||
version = "0.10.0+wasi-snapshot-preview1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
|
||||
|
||||
[[package]]
|
||||
name = "wasi"
|
||||
version = "0.11.0+wasi-snapshot-preview1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
|
||||
|
||||
[[package]]
|
||||
name = "wasm-bindgen"
|
||||
version = "0.2.86"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"wasm-bindgen-macro",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-backend"
|
||||
version = "0.2.86"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "19b04bc93f9d6bdee709f6bd2118f57dd6679cf1176a1af464fca3ab0d66d8fb"
|
||||
dependencies = [
|
||||
"bumpalo",
|
||||
"log",
|
||||
"once_cell",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
"wasm-bindgen-shared",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-macro"
|
||||
version = "0.2.86"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258"
|
||||
dependencies = [
|
||||
"quote",
|
||||
"wasm-bindgen-macro-support",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-macro-support"
|
||||
version = "0.2.86"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
"wasm-bindgen-backend",
|
||||
"wasm-bindgen-shared",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-shared"
|
||||
version = "0.2.86"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93"
|
||||
|
||||
[[package]]
|
||||
name = "winapi"
|
||||
version = "0.3.9"
|
||||
|
@ -867,21 +1050,36 @@ version = "0.4.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
|
||||
|
||||
[[package]]
|
||||
name = "winapi-util"
|
||||
version = "0.1.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
|
||||
dependencies = [
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "winapi-x86_64-pc-windows-gnu"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
||||
|
||||
[[package]]
|
||||
name = "windows"
|
||||
version = "0.48.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f"
|
||||
dependencies = [
|
||||
"windows-targets 0.48.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-sys"
|
||||
version = "0.42.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7"
|
||||
dependencies = [
|
||||
"windows_aarch64_gnullvm 0.42.2",
|
||||
"windows_aarch64_msvc 0.42.2",
|
||||
"windows_i686_gnu 0.42.2",
|
||||
"windows_i686_msvc 0.42.2",
|
||||
"windows_x86_64_gnu 0.42.2",
|
||||
"windows_x86_64_gnullvm 0.42.2",
|
||||
"windows_x86_64_msvc 0.42.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-sys"
|
||||
version = "0.45.0"
|
||||
|
|
|
@ -6,8 +6,9 @@ edition = "2021"
|
|||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
chrono = "0.4.24"
|
||||
config = { path = "../config" }
|
||||
termcolor = "1.2.0"
|
||||
console = "0.15.5"
|
||||
thiserror = "1.0.40"
|
||||
tracing = "0.1.37"
|
||||
tracing-subscriber = "0.3.17"
|
||||
|
|
|
@ -1,53 +1,118 @@
|
|||
use console::{pad_str, style, Style};
|
||||
use std::{
|
||||
io::{stdout, Stdout, Write},
|
||||
sync::{Arc, RwLock},
|
||||
io::Write,
|
||||
num::NonZeroU64,
|
||||
sync::{Arc, Mutex, RwLock},
|
||||
};
|
||||
|
||||
use tracing::{span, Level, Subscriber};
|
||||
use tracing::{field::Visit, span, Level, Subscriber};
|
||||
|
||||
#[derive(thiserror::Error, Debug)]
|
||||
pub struct Logger<T: Write> {
|
||||
pub struct Logger<T>
|
||||
where
|
||||
T: Write,
|
||||
{
|
||||
log_level: Level,
|
||||
writer: Arc<RwLock<T>>,
|
||||
log_id: Mutex<NonZeroU64>,
|
||||
}
|
||||
|
||||
impl<T: Write> Logger<T> {
|
||||
impl<T> Logger<T>
|
||||
where
|
||||
T: Write,
|
||||
{
|
||||
pub fn new(log_level: Level, writer: T) -> Self {
|
||||
Self {
|
||||
log_level,
|
||||
writer: RwLock::new(writer).into(),
|
||||
log_id: NonZeroU64::new(1).unwrap().into(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Write + 'static> Subscriber for Logger<T> {
|
||||
impl<T> Subscriber for Logger<T>
|
||||
where
|
||||
T: Write + 'static,
|
||||
{
|
||||
fn enabled(&self, metadata: &tracing::Metadata<'_>) -> bool {
|
||||
&self.log_level <= metadata.level()
|
||||
&self.log_level >= metadata.level()
|
||||
}
|
||||
|
||||
fn new_span(&self, span: &span::Attributes<'_>) -> span::Id {
|
||||
todo!()
|
||||
fn new_span(&self, _span: &span::Attributes<'_>) -> span::Id {
|
||||
let id = match self.log_id.lock() {
|
||||
Ok(mut v) => {
|
||||
*v = v.checked_add(1).unwrap();
|
||||
*v
|
||||
}
|
||||
Err(_) => NonZeroU64::new(1).unwrap(),
|
||||
};
|
||||
span::Id::from_non_zero_u64(id)
|
||||
}
|
||||
|
||||
fn record(&self, span: &span::Id, values: &span::Record<'_>) {
|
||||
todo!()
|
||||
fn record(&self, _span: &span::Id, _values: &span::Record<'_>) {
|
||||
//todo!()
|
||||
}
|
||||
|
||||
fn record_follows_from(&self, span: &span::Id, follows: &span::Id) {
|
||||
todo!()
|
||||
fn record_follows_from(&self, _span: &span::Id, _followss: &span::Id) {
|
||||
//todo!()
|
||||
}
|
||||
|
||||
fn event(&self, event: &tracing::Event<'_>) {
|
||||
let mut out_buffer = self.writer.write().unwrap();
|
||||
//let mut out_buffer = Ansi::new(out_buffer.deref_mut());
|
||||
|
||||
writeln!(out_buffer, "{:#?}", event.metadata()).unwrap();
|
||||
//_ = out_buffer.write_all(
|
||||
|
||||
let level = *event.metadata().level();
|
||||
|
||||
let header = Style::new();
|
||||
let s = pad_str(level.as_str(), 5, console::Alignment::Left, None);
|
||||
let header = match level {
|
||||
Level::ERROR => header.red(),
|
||||
Level::WARN => header.yellow(),
|
||||
Level::INFO => header.white(),
|
||||
Level::DEBUG => header.cyan(),
|
||||
Level::TRACE => header.bright().black(),
|
||||
};
|
||||
|
||||
let mut visitor = V(String::new(), true);
|
||||
event.record(&mut visitor);
|
||||
|
||||
let message = header.apply_to(format!(
|
||||
"{}: [{}] {}",
|
||||
s,
|
||||
style(chrono::offset::Local::now()).bright(),
|
||||
visitor.0
|
||||
));
|
||||
|
||||
_ = writeln!(out_buffer, "{message}");
|
||||
|
||||
// );
|
||||
|
||||
_ = out_buffer.flush();
|
||||
|
||||
//write!(out_buffer, "{:#?}", event.metadata()).unwrap();
|
||||
|
||||
/// A visitor for determining the contents of the fields
|
||||
#[derive(Default)]
|
||||
struct V(String, bool);
|
||||
|
||||
impl Visit for V {
|
||||
fn record_debug(&mut self, field: &tracing::field::Field, value: &dyn std::fmt::Debug) {
|
||||
self.0.push_str(&if self.1 {
|
||||
format!("{}={:#?}", field.name(), value)
|
||||
} else {
|
||||
format!("{}={:?}", field.name(), value)
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn enter(&self, span: &span::Id) {
|
||||
todo!()
|
||||
fn enter(&self, _span: &span::Id) {
|
||||
//todo!()
|
||||
}
|
||||
|
||||
fn exit(&self, span: &span::Id) {
|
||||
todo!()
|
||||
fn exit(&self, _span: &span::Id) {
|
||||
//todo!()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,4 +10,6 @@ axum = "0.6.18"
|
|||
tokio = { version = "1.28.1", features = ["full"] }
|
||||
config = { path = "../config" }
|
||||
macros = { path = "../macros" }
|
||||
logging = { path = "../logging" }
|
||||
anyhow = "1.0.71"
|
||||
tracing = "0.1.37"
|
||||
|
|
|
@ -3,6 +3,8 @@ use axum::Router;
|
|||
use config::get_config;
|
||||
use tokio::runtime;
|
||||
|
||||
use tracing::info;
|
||||
|
||||
pub mod api {
|
||||
pub mod routes;
|
||||
}
|
||||
|
@ -11,6 +13,7 @@ pub enum Error {}
|
|||
|
||||
pub fn init() -> anyhow::Result<()> {
|
||||
// initialize tokio runtime
|
||||
info!("Initializing tokio runtime");
|
||||
let mut rt = runtime::Builder::new_multi_thread();
|
||||
|
||||
let rt = rt.enable_all();
|
||||
|
@ -23,12 +26,13 @@ pub fn init() -> anyhow::Result<()> {
|
|||
|
||||
let app = Router::new().nest("/api", api::routes::routes());
|
||||
|
||||
type Result = anyhow::Result<()>;
|
||||
|
||||
rt.block_on(async {
|
||||
axum::Server::bind(&format!("127.0.0.1:{}", get_config()?.port).parse()?)
|
||||
.serve(app.into_make_service())
|
||||
.await?;
|
||||
anyhow::Result::<()>::Ok(()) // FIXME: for some reason I can't figure out the syntax for a
|
||||
// return type on an `async {}` block
|
||||
Result::Ok(())
|
||||
})?;
|
||||
|
||||
Ok(())
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
use std::{
|
||||
env, fmt,
|
||||
path::{Path, PathBuf}, io::stdout,
|
||||
io::stdout,
|
||||
path::{Path, PathBuf},
|
||||
};
|
||||
use tracing::debug;
|
||||
use tracing::{debug, error};
|
||||
|
||||
#[macro_use]
|
||||
extern crate macros;
|
||||
|
@ -17,14 +18,23 @@ fn main() -> anyhow::Result<()> {
|
|||
);
|
||||
|
||||
// logging
|
||||
let subscriber = logging::Logger::new(if is_release!() {
|
||||
tracing::Level::INFO
|
||||
} else {
|
||||
tracing::Level::DEBUG
|
||||
}, stdout());
|
||||
let subscriber = logging::Logger::new(
|
||||
if is_release!() {
|
||||
tracing::Level::INFO
|
||||
} else {
|
||||
tracing::Level::TRACE
|
||||
},
|
||||
stdout(),
|
||||
);
|
||||
|
||||
tracing::subscriber::set_global_default(subscriber)?;
|
||||
|
||||
tracing::info!("info");
|
||||
tracing::trace!("trace");
|
||||
tracing::debug!("debug");
|
||||
tracing::warn!("warn");
|
||||
tracing::error!("error");
|
||||
|
||||
// bootstrap
|
||||
|
||||
// ENV
|
||||
|
@ -39,7 +49,9 @@ fn main() -> anyhow::Result<()> {
|
|||
|
||||
debug!(config_file = ?config::get_config());
|
||||
|
||||
server::init()?;
|
||||
if let Err(e) = server::init() {
|
||||
error!("Fatal error in server core: {}", e);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue