v0.2.6-pre.003
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-config-lib/src/logging.rs
|
||||
// version: 1
|
||||
// version: 2
|
||||
|
||||
/// Effective standard Logging configuration resolved from Config and mapped to the Logging runtime contract.
|
||||
#[derive(Clone, Eq, PartialEq)]
|
||||
@@ -103,6 +103,24 @@ impl crate::ConfigDocumentEngine {
|
||||
};
|
||||
return resolve_logging_profile(&profile, environment);
|
||||
}
|
||||
|
||||
/// Maps an already resolved standard Logging profile to the runtime Logging adapter while preserving its selection provenance.
|
||||
///
|
||||
/// This entry point is intended for profiles selected by a composite. The profile must reference `cfg.std.logging`.
|
||||
pub fn resolve_logging_config_profile(
|
||||
&self,
|
||||
profile: &crate::ResolvedConfigProfile,
|
||||
environment: &crate::ConfigEnvironment,
|
||||
) -> ksp_core_lib::Result<ResolvedLoggingConfig> {
|
||||
if profile.file_id().as_str() != crate::FILE_ID_STD_LOGGING {
|
||||
return std::result::Result::Err(effective_error(profile, "resolved Config profile does not reference the standard Logging document"));
|
||||
}
|
||||
let descriptor = self.registry().descriptor(profile.file_id());
|
||||
if let std::result::Result::Err(error) = descriptor {
|
||||
return std::result::Result::Err(error);
|
||||
}
|
||||
return resolve_logging_profile(profile, environment);
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(serde::Deserialize)]
|
||||
|
||||
Reference in New Issue
Block a user