v0.1.4-pre.016-fix.001
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# file: crates/ksp-app-config-desk/Cargo.toml
|
||||
# version: 6
|
||||
# version: 7
|
||||
|
||||
[package]
|
||||
name = "ksp-app-config-desk"
|
||||
@@ -30,7 +30,7 @@ serde.workspace = true
|
||||
serde_json.workspace = true
|
||||
tauri.workspace = true
|
||||
tauri-plugin-tracing.workspace = true
|
||||
time.workspace = true
|
||||
chrono.workspace = true
|
||||
tokio.workspace = true
|
||||
ts-rs.workspace = true
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-app-config-desk/src/logging_runtime.rs
|
||||
// version: 1
|
||||
// version: 2
|
||||
|
||||
//! Runtime Logging metadata, launch identity and explicit profile application for Config Desk.
|
||||
|
||||
@@ -51,19 +51,7 @@ pub(crate) struct LoggingRuntimeStatusDto {
|
||||
|
||||
/// Creates the stable runtime identity for this Config Desk process launch.
|
||||
pub(crate) fn launch_identity() -> ksp_core_lib::Result<ksp_logging_lib::LoggingRuntimeIdentity> {
|
||||
let now = time::OffsetDateTime::now_utc();
|
||||
let milliseconds = now.nanosecond() / 1_000_000;
|
||||
let timestamp = format!(
|
||||
"{:04}{:02}{:02}-{:02}{:02}{:02}.{:03}Z-p{}",
|
||||
now.year(),
|
||||
now.month() as u8,
|
||||
now.day(),
|
||||
now.hour(),
|
||||
now.minute(),
|
||||
now.second(),
|
||||
milliseconds,
|
||||
std::process::id(),
|
||||
);
|
||||
let timestamp = format!("{}-p{}", chrono::Utc::now().format("%Y%m%d-%H%M%S%.3fZ"), std::process::id());
|
||||
return ksp_logging_lib::LoggingRuntimeIdentity::new(crate::TRACING_TARGET, timestamp);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-logging-lib/src/runtime.rs
|
||||
// version: 12
|
||||
// version: 13
|
||||
|
||||
use tracing_subscriber::Layer; // rust-rules: trait-import
|
||||
use tracing_subscriber::layer::SubscriberExt; // rust-rules: trait-import
|
||||
@@ -282,10 +282,6 @@ pub fn reinitialize(guard: &mut crate::LoggingGuard, settings: &crate::LoggingSe
|
||||
});
|
||||
}
|
||||
|
||||
fn prepare_runtime(settings: &crate::LoggingSettings) -> ksp_core_lib::Result<PreparedRuntime> {
|
||||
return prepare_runtime_with_identity(settings, std::option::Option::None);
|
||||
}
|
||||
|
||||
fn prepare_runtime_with_identity(
|
||||
settings: &crate::LoggingSettings,
|
||||
runtime_identity: std::option::Option<&crate::LoggingRuntimeIdentity>,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-logging-lib/unit_tests/runtime.rs
|
||||
// version: 10
|
||||
// version: 11
|
||||
|
||||
#[test]
|
||||
fn level_mapping_covers_all_ksp_levels() {
|
||||
@@ -48,7 +48,7 @@ fn file_rotation_mapping_covers_supported_cadences() {
|
||||
#[test]
|
||||
fn disabled_runtime_has_no_layers_or_outputs() {
|
||||
let settings = crate::LoggingSettings::new(crate::LogFilterLevel::Info, crate::SpanEvents::Off, std::option::Option::None, std::vec::Vec::new());
|
||||
let result = super::prepare_runtime(&settings);
|
||||
let result = super::prepare_runtime_with_identity(&settings, std::option::Option::None);
|
||||
assert!(result.is_ok());
|
||||
let prepared = match result {
|
||||
std::result::Result::Ok(prepared) => prepared,
|
||||
@@ -67,7 +67,7 @@ fn console_runtime_composes_takeover_filter_before_formatter_and_owns_guard() {
|
||||
std::option::Option::Some(crate::ConsoleSettings::stdout()),
|
||||
std::vec::Vec::new(),
|
||||
);
|
||||
let result = super::prepare_runtime(&settings);
|
||||
let result = super::prepare_runtime_with_identity(&settings, std::option::Option::None);
|
||||
assert!(result.is_ok());
|
||||
let prepared = match result {
|
||||
std::result::Result::Ok(prepared) => prepared,
|
||||
@@ -137,7 +137,7 @@ fn multi_sink_runtime_accepts_metadata_routing_formats_and_console_ansi() {
|
||||
std::option::Option::Some(console),
|
||||
std::vec![first_file, second_file],
|
||||
);
|
||||
let result = super::prepare_runtime(&settings);
|
||||
let result = super::prepare_runtime_with_identity(&settings, std::option::Option::None);
|
||||
assert!(result.is_ok());
|
||||
let prepared = match result {
|
||||
std::result::Result::Ok(prepared) => prepared,
|
||||
@@ -164,7 +164,7 @@ fn domain_routing_is_accepted_by_runtime_preparation() {
|
||||
);
|
||||
let settings = crate::LoggingSettings::new(crate::LogFilterLevel::Info, crate::SpanEvents::Off, std::option::Option::Some(console), std::vec::Vec::new());
|
||||
assert!(settings.validate().is_ok());
|
||||
let result = super::prepare_runtime(&settings);
|
||||
let result = super::prepare_runtime_with_identity(&settings, std::option::Option::None);
|
||||
assert!(result.is_ok());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user