|
10 | 10 | // SPDX-License-Identifier: Apache-2.0 |
11 | 11 |
|
12 | 12 | use crate::error_code::ErrorCode; |
13 | | -use crate::kvs_api::{DebugT, InstanceId, KvsApi, KvsDefaults, KvsLoad, SnapshotId}; |
| 13 | +use crate::kvs_api::{InstanceId, KvsApi, KvsDefaults, KvsLoad, SnapshotId}; |
14 | 14 | use crate::kvs_backend::KvsBackend; |
15 | 15 | use crate::kvs_builder::KvsData; |
16 | 16 | use crate::kvs_value::{KvsMap, KvsValue}; |
17 | | -use crate::log::{error, warn}; |
| 17 | +use mw_log::{error, fmt::ScoreDebug, warn}; |
18 | 18 | use std::sync::{Arc, Mutex}; |
19 | 19 |
|
20 | 20 | /// KVS instance parameters. |
21 | | -#[derive(Debug)] |
22 | | -#[cfg_attr(feature = "score-log", derive(mw_log::ScoreDebug))] |
| 21 | +#[derive(mw_log::ScoreDebug)] |
23 | 22 | pub struct KvsParameters { |
24 | 23 | /// Instance ID. |
25 | 24 | pub instance_id: InstanceId, |
@@ -153,7 +152,7 @@ impl KvsApi for Kvs { |
153 | 152 | fn get_value_as<T>(&self, key: &str) -> Result<T, ErrorCode> |
154 | 153 | where |
155 | 154 | for<'a> T: TryFrom<&'a KvsValue>, |
156 | | - for<'a> <T as TryFrom<&'a KvsValue>>::Error: DebugT, |
| 155 | + for<'a> <T as TryFrom<&'a KvsValue>>::Error: ScoreDebug, |
157 | 156 | { |
158 | 157 | let data = self.data.lock()?; |
159 | 158 | if let Some(value) = data.kvs_map.get(key) { |
@@ -349,8 +348,7 @@ mod kvs_tests { |
349 | 348 |
|
350 | 349 | /// Most tests can be performed with mocked backend. |
351 | 350 | /// Only those with file handling must use concrete implementation. |
352 | | - #[derive(PartialEq, Debug)] |
353 | | - #[cfg_attr(feature = "score-log", derive(mw_log::ScoreDebug))] |
| 351 | + #[derive(PartialEq, Debug, mw_log::ScoreDebug)] |
354 | 352 | struct MockBackend; |
355 | 353 |
|
356 | 354 | impl KvsBackend for MockBackend { |
|
0 commit comments