Skip to content

Commit

Permalink
refactor(mcu-util): use orb-telemetry (#321)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheButlah authored Dec 11, 2024
1 parent 059c436 commit ecea63a
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 29 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ orb-attest-dbus.path = "attest/dbus"
orb-build-info.path = "build-info"
orb-const-concat.path = "const-concat"
orb-header-parsing.path = "header-parsing"
orb-mcu-interface.path = "mcu-interface"
orb-security-utils.path = "security-utils"
orb-slot-ctrl.path = "slot-ctrl"
orb-telemetry.path = "telemetry"
Expand Down
7 changes: 4 additions & 3 deletions mcu-util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ async-trait = "0.1.77"
clap.workspace = true
color-eyre.workspace = true
crc32fast = "1.3.2"
futures.workspace = true
image = "0.24.8"
orb-mcu-interface.path = "../mcu-interface"
orb-build-info.workspace = true
orb-mcu-interface.workspace = true
orb-telemetry.workspace = true
tokio.workspace = true
tracing-subscriber.workspace = true
tracing.workspace = true
futures.workspace = true
orb-build-info.path = "../build-info"

[build-dependencies]
orb-build-info = { path = "../build-info", features = ["build-script"] }
Expand Down
24 changes: 0 additions & 24 deletions mcu-util/src/logging.rs

This file was deleted.

3 changes: 1 addition & 2 deletions mcu-util/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ use tracing::{debug, error};

use crate::orb::Orb;

mod logging;
mod orb;

static BUILD_INFO: BuildInfo = make_build_info!();
Expand Down Expand Up @@ -268,7 +267,7 @@ fn clap_v3_styles() -> Styles {
#[tokio::main]
async fn main() -> Result<()> {
color_eyre::install()?;
logging::init()?;
orb_telemetry::TelemetryConfig::new().init();

let args = Args::parse();

Expand Down
3 changes: 3 additions & 0 deletions telemetry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ impl TelemetryConfig {
/// Provides all required arguments for telemetry configuration.
/// - `log_identifier` will be used for journald, if appropriate.
#[expect(clippy::new_without_default, reason = "may add required args later")]
#[must_use]
pub fn new() -> Self {
Self {
syslog_identifier: None,
Expand All @@ -27,6 +28,7 @@ impl TelemetryConfig {
/// Enables journald, and uses the provided syslog identifier.
///
/// If you run the application in a tty, stderr will be used instead.
#[must_use]
pub fn with_journald(self, syslog_identifier: &str) -> Self {
Self {
syslog_identifier: Some(syslog_identifier.to_owned()),
Expand All @@ -36,6 +38,7 @@ impl TelemetryConfig {

/// Override the global filter to a custom filter.
/// Only do this if actually necessary to deviate from the orb's defaults.
#[must_use]
pub fn with_global_filter(self, filter: EnvFilter) -> Self {
Self {
global_filter: filter,
Expand Down

0 comments on commit ecea63a

Please sign in to comment.