feat(tvix/build): drop json logging

This has already been dropped for tvix-store, drop it here as well.

Change-Id: Ib3aa37bbe9fd4c498b5ba1213f7d922d0c64ffc7
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11677
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Tested-by: BuildkiteCI
This commit is contained in:
Florian Klink 2024-05-16 21:41:47 +02:00 committed by clbot
parent 6aa1d2c4a8
commit d65e6df3ab
3 changed files with 6 additions and 21 deletions

View file

@ -12772,7 +12772,6 @@ rec {
{ {
name = "tracing-subscriber"; name = "tracing-subscriber";
packageId = "tracing-subscriber"; packageId = "tracing-subscriber";
features = [ "json" ];
} }
{ {
name = "tvix-castore"; name = "tvix-castore";

View file

@ -14,7 +14,7 @@ tokio-listener = { version = "0.4.1", features = [ "tonic011" ] }
tonic = { version = "0.11.0", features = ["tls", "tls-roots"] } tonic = { version = "0.11.0", features = ["tls", "tls-roots"] }
tvix-castore = { path = "../castore" } tvix-castore = { path = "../castore" }
tracing = "0.1.37" tracing = "0.1.37"
tracing-subscriber = { version = "0.3.16", features = ["json"] } tracing-subscriber = { version = "0.3.16" }
url = "2.4.0" url = "2.4.0"
[dependencies.tonic-reflection] [dependencies.tonic-reflection]

View file

@ -23,10 +23,6 @@ use tvix_castore::proto::FILE_DESCRIPTOR_SET as CASTORE_FILE_DESCRIPTOR_SET;
#[derive(Parser)] #[derive(Parser)]
#[command(author, version, about, long_about = None)] #[command(author, version, about, long_about = None)]
struct Cli { struct Cli {
/// Whether to log in JSON
#[arg(long)]
json: bool,
#[arg(long)] #[arg(long)]
log_level: Option<Level>, log_level: Option<Level>,
@ -58,23 +54,13 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
// configure log settings // configure log settings
let level = cli.log_level.unwrap_or(Level::INFO); let level = cli.log_level.unwrap_or(Level::INFO);
let subscriber = tracing_subscriber::registry() tracing_subscriber::registry()
.with( .with(
cli.json.then_some( tracing_subscriber::fmt::Layer::new()
tracing_subscriber::fmt::Layer::new() .with_writer(std::io::stderr.with_max_level(level))
.with_writer(std::io::stderr.with_max_level(level)) .pretty(),
.json(),
),
) )
.with( .init();
(!cli.json).then_some(
tracing_subscriber::fmt::Layer::new()
.with_writer(std::io::stderr.with_max_level(level))
.pretty(),
),
);
tracing::subscriber::set_global_default(subscriber).expect("Unable to set global subscriber");
match cli.command { match cli.command {
Commands::Daemon { Commands::Daemon {