@@ -181,6 +181,7 @@ pub struct Server<C = HttpConnector, A = AddrIncoming, D = HttpsConnector<HttpCo
181181 pub should_sync_from_storage : bool ,
182182 pub force_load_wals : bool ,
183183 pub sync_conccurency : usize ,
184+ pub set_log_level : Option < Box < dyn Fn ( & str ) -> anyhow:: Result < ( ) > + Send + Sync + ' static > > ,
184185}
185186
186187impl < C , A , D > Default for Server < C , A , D > {
@@ -210,6 +211,7 @@ impl<C, A, D> Default for Server<C, A, D> {
210211 should_sync_from_storage : false ,
211212 force_load_wals : false ,
212213 sync_conccurency : 8 ,
214+ set_log_level : None ,
213215 }
214216 }
215217}
@@ -225,6 +227,7 @@ struct Services<A, P, S, C> {
225227 disable_default_namespace : bool ,
226228 db_config : DbConfig ,
227229 user_auth_strategy : Auth ,
230+ pub set_log_level : Option < Box < dyn Fn ( & str ) -> anyhow:: Result < ( ) > + Send + Sync + ' static > > ,
228231}
229232
230233struct TaskManager {
@@ -304,7 +307,7 @@ where
304307 S : ReplicationLog ,
305308 C : Connector ,
306309{
307- fn configure ( self , task_manager : & mut TaskManager ) {
310+ fn configure ( mut self , task_manager : & mut TaskManager ) {
308311 let user_http = UserApi {
309312 http_acceptor : self . user_api_config . http_acceptor ,
310313 hrana_ws_acceptor : self . user_api_config . hrana_ws_acceptor ,
@@ -339,6 +342,7 @@ where
339342 disable_metrics,
340343 shutdown,
341344 auth_key. map ( Into :: into) ,
345+ self . set_log_level . take ( ) ,
342346 )
343347 } ) ;
344348 }
@@ -538,7 +542,7 @@ where
538542 }
539543
540544 fn make_services < P : Proxy , L : ReplicationLog > (
541- self ,
545+ mut self ,
542546 namespace_store : NamespaceStore ,
543547 idle_shutdown_kicker : Option < IdleShutdownKicker > ,
544548 proxy_service : P ,
@@ -556,6 +560,7 @@ where
556560 disable_default_namespace : self . disable_default_namespace ,
557561 db_config : self . db_config ,
558562 user_auth_strategy,
563+ set_log_level : self . set_log_level . take ( ) ,
559564 }
560565 }
561566
0 commit comments