Replace gRPC Backend #10

Merged
sergeysav merged 15 commits from ssavelyev/grpc_removal into main 2026-01-01 10:11:53 -08:00
3 changed files with 22 additions and 5 deletions
Showing only changes of commit 5853187cd6 - Show all commits

11
Cargo.lock generated
View File

@@ -473,6 +473,16 @@ version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75"
[[package]]
name = "colored"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c"
dependencies = [
"lazy_static",
"windows-sys 0.48.0",
]
[[package]] [[package]]
name = "concurrent-queue" name = "concurrent-queue"
version = "2.5.0" version = "2.5.0"
@@ -735,6 +745,7 @@ version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4316185f709b23713e41e3195f90edef7fb00c3ed4adc79769cf09cc762a3b29" checksum = "4316185f709b23713e41e3195f90edef7fb00c3ed4adc79769cf09cc762a3b29"
dependencies = [ dependencies = [
"colored",
"log", "log",
] ]

View File

@@ -12,7 +12,7 @@ anyhow = { workspace = true }
api = { path = "../api" } api = { path = "../api" }
chrono = { workspace = true } chrono = { workspace = true }
derive_more = { workspace = true, features = ["from"] } derive_more = { workspace = true, features = ["from"] }
fern = { workspace = true } fern = { workspace = true, features = ["colored"] }
futures-util = { workspace = true } futures-util = { workspace = true }
log = { workspace = true } log = { workspace = true }
papaya = { workspace = true } papaya = { workspace = true }

View File

@@ -1,3 +1,4 @@
use fern::colors::{Color, ColoredLevelConfig};
use std::env; use std::env;
use std::str::FromStr; use std::str::FromStr;
@@ -9,14 +10,18 @@ async fn main() -> anyhow::Result<()> {
Err(_) => log::LevelFilter::Info, Err(_) => log::LevelFilter::Info,
}; };
let colors = ColoredLevelConfig::new()
.info(Color::Green)
.debug(Color::Blue);
let mut log_config = fern::Dispatch::new() let mut log_config = fern::Dispatch::new()
.format(|out, message, record| { .format(move |out, message, record| {
out.finish(format_args!( out.finish(format_args!(
"[{}][{}][{}] {}", "[{} {} {}] {}",
chrono::Utc::now().format("%Y-%m-%d %H:%M:%S"), chrono::Utc::now().format("%Y-%m-%d %H:%M:%S"),
colors.color(record.level()),
record.target(), record.target(),
record.level(), message,
message
)) ))
}) })
.level(log::LevelFilter::Warn) .level(log::LevelFilter::Warn)
@@ -27,5 +32,6 @@ async fn main() -> anyhow::Result<()> {
log_config = log_config.chain(fern::log_file(log_file)?) log_config = log_config.chain(fern::log_file(log_file)?)
} }
log_config.apply()?; log_config.apply()?;
server::setup().await server::setup().await
} }