Files
radicle-ci-broker/Cargo.toml
T
Lars Wirzenius cf395350ea feat: use the tracing crate for structured logging
Switch from the "slog" family of crates for structured logging to the
"tracing" family. There should be no significant changes to the log
messages, so I don't consider this to be a breaking change.

The benefit of this change is that it opens up the possibility to add
extra fields to the log messages as JSON values, instead of strings
that contain the values as JSON.

With slog we currently have this message::

  {"msg":"broker database: /home/_rad/ci-broker.db"}

With slog or tracing we can change this to:

  {"msg":"open database", "filename": "/home/_rad/ci-broker.db"}

With tracing we can have this:

  {"msg":"open database","db":{"type":"sqlite","filename":"/home/_rad/ci-broker.db","size":12765}}

which would be, formatted prettily

  {
    "msg": "open database",
    "db": {
      "type": "sqlite",
      "filename": "/home/_rad/ci-broker.db",
      "size": 12765
    }
  }

Such extra fields can then be easily queried or otherwise processed
with programs, much more easily than having such programs parse text
fields as JSON before they can be processed.

Doing this with slog is supposed to be possible, but I have failed to
get it to work. The slog and tracing families of libraries seem
otherwise similar for our purposes.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-11-26 18:57:25 +02:00

46 lines
1.5 KiB
TOML

[package]
name = "radicle-ci-broker"
version = "0.9.0"
edition = "2021"
rust-version = "1.80"
authors = ["Lars Wirzenius <liw@liw.fi", "cloudhead <cloudhead@radicle.xyz>"]
description = "add integration to CI engins or systems to a Radicle node"
license = "MIT OR Apache-2.0"
homepage = "https://radicle.xyz"
repository = "https://app.radicle.xyz/nodes/radicle.liw.fi/rad:zwTxygwuz5LDGBq255RA2CbNGrz8"
categories = ["development-tools::build-utils"]
[dependencies]
anyhow = "1.0.86"
clap = { version = "4.5.11", features = ["derive", "wrap_help"] }
duration-str = "0.11.2"
html-page = "0.4.0"
radicle-git-ext = "0.8.0"
radicle-surf = { version = "0.22.0", default-features = false, features = ["serde"] }
regex = "1.10.5"
rss = "2.0.9"
serde = { version = "1.0.204", features = ["derive"] }
serde_json = "1.0.121"
serde_yml = "0.0.11"
sqlite = "0.32.0"
sqlite3-sys = "0.15.0"
subplotlib = "0.11.0"
tempfile = { version = "3.10.1" }
thiserror = "1.0.63"
time = { version = "0.3.36", features = ["formatting", "macros"] }
tracing = { version = "0.1.40", features = ["max_level_trace", "release_max_level_trace", "valuable"] }
tracing-subscriber = { version = "0.3.18", features = ["env-filter", "fmt", "json", "valuable"] }
uuid = { version = "1.10.0", features = ["v4"] }
valuable = { version = "0.1.0", features = ["derive"] }
[dependencies.radicle]
version = "0.13.0"
features = ["default", "test"]
[dev-dependencies]
ctor = "0.2.8"
culpa = "1.0.2"
[build-dependencies]
subplot-build = "0.11.0"