File tree Expand file tree Collapse file tree 4 files changed +13
-6
lines changed
mithril-aggregator/src/dependency_injection
mithril-signer/src/runtime Expand file tree Collapse file tree 4 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -534,6 +534,7 @@ impl DependenciesBuilder {
534
534
& self . configuration . data_stores_directory ,
535
535
& format ! ( "immutables_digests_{}.json" , self . configuration. network) ,
536
536
)
537
+ . with_logger ( self . get_logger ( ) . await ?)
537
538
. should_reset_digests_cache ( self . configuration . reset_digests_cache )
538
539
. build ( )
539
540
. await ?;
Original file line number Diff line number Diff line change @@ -44,11 +44,7 @@ serde_json = "1.0.107"
44
44
serde_with = " 3.3.0"
45
45
serde_yaml = " 0.9.25"
46
46
sha2 = " 0.10.8"
47
- slog = { version = " 2.7.0" , features = [
48
- " max_level_trace" ,
49
- " release_max_level_debug" ,
50
- ] }
51
- slog-scope = " 4.4.0"
47
+ slog = " 2.7.0"
52
48
sqlite = { version = " 0.31.1" , features = [" bundled" ] }
53
49
strum = { version = " 0.25.0" , features = [" derive" ] }
54
50
thiserror = " 1.0.49"
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ use crate::{
3
3
StdResult ,
4
4
} ;
5
5
use anyhow:: Context ;
6
- use slog_scope :: info;
6
+ use slog :: { info, Logger } ;
7
7
use std:: path:: Path ;
8
8
use tokio:: fs;
9
9
@@ -13,6 +13,7 @@ pub struct JsonImmutableFileDigestCacheProviderBuilder<'a> {
13
13
filename : & ' a str ,
14
14
ensure_dir_exist : bool ,
15
15
reset_digests_cache : bool ,
16
+ logger : Logger ,
16
17
}
17
18
18
19
impl < ' a > JsonImmutableFileDigestCacheProviderBuilder < ' a > {
@@ -23,6 +24,7 @@ impl<'a> JsonImmutableFileDigestCacheProviderBuilder<'a> {
23
24
filename,
24
25
ensure_dir_exist : false ,
25
26
reset_digests_cache : false ,
27
+ logger : Logger :: root ( slog:: Discard , slog:: o!( ) ) ,
26
28
}
27
29
}
28
30
@@ -38,6 +40,12 @@ impl<'a> JsonImmutableFileDigestCacheProviderBuilder<'a> {
38
40
self
39
41
}
40
42
43
+ /// Set the [Logger] to use.
44
+ pub fn with_logger ( & mut self , logger : Logger ) -> & mut Self {
45
+ self . logger = logger;
46
+ self
47
+ }
48
+
41
49
/// Build a [JsonImmutableFileDigestCacheProvider] based on the parameters previously set.
42
50
pub async fn build ( & self ) -> StdResult < JsonImmutableFileDigestCacheProvider > {
43
51
let cache_file = self . cache_dir . join ( self . filename ) ;
@@ -62,6 +70,7 @@ impl<'a> JsonImmutableFileDigestCacheProviderBuilder<'a> {
62
70
}
63
71
64
72
info ! (
73
+ self . logger,
65
74
"Storing/Getting immutables digests cache from: {}" ,
66
75
cache_file. display( )
67
76
) ;
Original file line number Diff line number Diff line change @@ -130,6 +130,7 @@ impl<'a> ProductionServiceBuilder<'a> {
130
130
& format ! ( "immutables_digests_{}.json" , self . config. network) ,
131
131
)
132
132
. should_reset_digests_cache ( self . config . reset_digests_cache )
133
+ . with_logger ( slog_scope:: logger ( ) )
133
134
. build ( )
134
135
. await ?;
135
136
You can’t perform that action at this time.
0 commit comments