Skip to content

Commit

Permalink
Merge pull request #2212 from reubenmiller/fix-tedge-log-plugin-incon…
Browse files Browse the repository at this point in the history
…sistencies

fix: align tedge-log-plugin settings
  • Loading branch information
reubenmiller authored Sep 3, 2023
2 parents 47baff1 + d8e5443 commit 7436693
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 22 deletions.
17 changes: 9 additions & 8 deletions Cargo.lock

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

Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,6 @@ impl TEdgeConfig {
}
client_auth
}

pub fn mqtt_internal_config(&self) -> mqtt_channel::Config {
let host = self.mqtt.bind.address.to_string();
let port = self.mqtt.bind.port.get();

mqtt_channel::Config::default()
.with_host(host)
.with_port(port)
}
}

#[derive(serde::Deserialize, serde::Serialize, Clone, Copy, PartialEq, Eq, Debug)]
Expand Down
11 changes: 6 additions & 5 deletions plugins/tedge_log_plugin/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ async fn main() -> Result<(), anyhow::Error> {
let tedge_config_location = TEdgeConfigLocation::from_custom_root(&logfile_opt.config_dir);

let log_level = if logfile_opt.debug {
tracing::Level::TRACE
tracing::Level::DEBUG
} else {
get_log_level(
"tedge-log-plugin",
Expand Down Expand Up @@ -87,10 +87,11 @@ async fn run(
let runtime_events_logger = None;
let mut runtime = Runtime::try_new(runtime_events_logger).await?;

let mqtt_config = tedge_config
.mqtt_internal_config()
.with_session_name(TEDGE_LOG_PLUGIN);
let mut mqtt_actor = MqttActorBuilder::new(mqtt_config);
let mqtt_config = tedge_config.mqtt_config()?;
let mut mqtt_actor = MqttActorBuilder::new(mqtt_config.clone().with_session_name(format!(
"{}#{}/{}",
TEDGE_LOG_PLUGIN, topic_root, topic_identifier
)));

let mut fs_watch_actor = FsWatchActorBuilder::new();

Expand Down

1 comment on commit 7436693

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
261 0 5 261 100 49m17.2s

Please sign in to comment.