Skip to content

Commit

Permalink
Merge log_manager crate under tedge_log_manager
Browse files Browse the repository at this point in the history
Signed-off-by: Didier Wenzek <[email protected]>
  • Loading branch information
didier-wenzek committed Oct 30, 2024
1 parent 422d710 commit 14855ef
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 55 deletions.
25 changes: 6 additions & 19 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ itertools = "0.13"
json-writer = { path = "crates/common/json_writer" }
lazy_static = "1.4"
log = "0.4"
log_manager = { path = "crates/common/log_manager" }
maplit = "1.0"
miette = { version = "5.5.0", features = ["fancy"] }
mime = "0.3.17"
Expand Down
29 changes: 0 additions & 29 deletions crates/common/log_manager/Cargo.toml

This file was deleted.

8 changes: 7 additions & 1 deletion crates/extensions/tedge_log_manager/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ repository = { workspace = true }
[dependencies]
async-trait = { workspace = true }
camino = { workspace = true }
easy_reader = { workspace = true }
glob = { workspace = true }
log = { workspace = true }
log_manager = { workspace = true }
rand = { workspace = true }
regex = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
tedge_actors = { workspace = true }
tedge_api = { workspace = true }
Expand All @@ -22,6 +26,7 @@ tedge_file_system_ext = { workspace = true }
tedge_mqtt_ext = { workspace = true }
tedge_uploader_ext = { workspace = true }
tedge_utils = { workspace = true }
time = { workspace = true, features = ["formatting"] }
thiserror = { workspace = true }
tokio = { workspace = true, features = ["macros"] }
toml = { workspace = true }
Expand All @@ -32,6 +37,7 @@ assert-json-diff = { workspace = true }
filetime = { workspace = true }
tedge_actors = { workspace = true, features = ["test-helpers"] }
tedge_test_utils = { workspace = true }
time = { workspace = true, features = ["macros"] }

[lints]
workspace = true
4 changes: 2 additions & 2 deletions crates/extensions/tedge_log_manager/src/actor.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use std::collections::HashMap;

use crate::manager::LogPluginConfig;
use async_trait::async_trait;
use camino::Utf8Path;
use log::debug;
use log::error;
use log::info;
use log::warn;
use log_manager::LogPluginConfig;
use tedge_actors::fan_in_message_type;
use tedge_actors::Actor;
use tedge_actors::ChannelError;
Expand Down Expand Up @@ -156,7 +156,7 @@ impl LogManagerActor {
) -> Result<(), LogManagementError> {
let topic = request.topic(&self.config.mqtt_schema).as_ref().to_string();
let request = &request.payload;
let log_path = log_manager::new_read_logs(
let log_path = crate::manager::new_read_logs(
&self.plugin_config.files,
&request.log_type,
request.date_from,
Expand Down
2 changes: 1 addition & 1 deletion crates/extensions/tedge_log_manager/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub enum LogManagementError {
FromPathsError(#[from] tedge_utils::paths::PathsError),

#[error(transparent)]
FromLogRetrievalError(#[from] log_manager::LogRetrievalError),
FromLogRetrievalError(#[from] crate::manager::LogRetrievalError),
}

impl From<LogManagementError> for tedge_actors::RuntimeError {
Expand Down
3 changes: 2 additions & 1 deletion crates/extensions/tedge_log_manager/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
mod actor;
mod config;
mod error;
mod manager;

#[cfg(test)]
mod tests;

pub use actor::*;
pub use config::*;
use log::error;
use log_manager::LogPluginConfig;
use manager::LogPluginConfig;
use std::path::PathBuf;
use tedge_actors::Builder;
use tedge_actors::CloneSender;
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ mod tests {
use std::io::Write;

use super::*;
use crate::FileEntry;
use crate::manager::FileEntry;
use filetime::set_file_mtime;
use filetime::FileTime;
use tedge_test_utils::fs::TempTedgeDir;
Expand Down
File renamed without changes.

0 comments on commit 14855ef

Please sign in to comment.