@@ -42,7 +42,7 @@ func reloadHandler(ctx context.Context, _ os.Signal) (*csconfig.Config, error) {
4242
4343 if ! cConfig .DisableAPI {
4444 if flags .DisableCAPI {
45- log .Warningf ("Communication with CrowdSec Central API disabled from args" )
45+ log .Warning ("Communication with CrowdSec Central API disabled from args" )
4646
4747 cConfig .API .Server .OnlineClient = nil
4848 }
@@ -90,11 +90,11 @@ func reloadHandler(ctx context.Context, _ os.Signal) (*csconfig.Config, error) {
9090func ShutdownCrowdsecRoutines () error {
9191 var reterr error
9292
93- log .Debugf ("Shutting down crowdsec sub-routines" )
93+ log .Debug ("Shutting down crowdsec sub-routines" )
9494
9595 if len (dataSources ) > 0 {
9696 acquisTomb .Kill (nil )
97- log .Debugf ("waiting for acquisition to finish" )
97+ log .Debug ("waiting for acquisition to finish" )
9898 drainChan (inputLineChan )
9999
100100 if err := acquisTomb .Wait (); err != nil {
@@ -103,7 +103,7 @@ func ShutdownCrowdsecRoutines() error {
103103 }
104104 }
105105
106- log .Debugf ("acquisition is finished, wait for parser/bucket/ouputs." )
106+ log .Debug ("acquisition is finished, wait for parser/bucket/ouputs." )
107107 parsersTomb .Kill (nil )
108108 drainChan (inputEventChan )
109109
@@ -112,7 +112,7 @@ func ShutdownCrowdsecRoutines() error {
112112 reterr = err
113113 }
114114
115- log .Debugf ("parsers is done" )
115+ log .Debug ("parsers is done" )
116116 time .Sleep (1 * time .Second ) // ugly workaround for now to ensure PourItemtoholders are finished
117117 bucketsTomb .Kill (nil )
118118
@@ -121,7 +121,7 @@ func ShutdownCrowdsecRoutines() error {
121121 reterr = err
122122 }
123123
124- log .Debugf ("buckets is done" )
124+ log .Debug ("buckets is done" )
125125 time .Sleep (1 * time .Second ) // ugly workaround for now
126126 outputsTomb .Kill (nil )
127127
@@ -139,10 +139,10 @@ func ShutdownCrowdsecRoutines() error {
139139 reterr = err
140140 }
141141
142- log .Debugf ("outputs are done" )
142+ log .Debug ("outputs are done" )
143143 case <- time .After (3 * time .Second ):
144144 // this can happen if outputs are stuck in a http retry loop
145- log .Warningf ("Outputs didn't finish in time, some events may have not been flushed" )
145+ log .Warning ("Outputs didn't finish in time, some events may have not been flushed" )
146146 }
147147
148148 lpMetricsTomb .Kill (nil )
@@ -152,7 +152,7 @@ func ShutdownCrowdsecRoutines() error {
152152 reterr = err
153153 }
154154
155- log .Debugf ("metrics are done" )
155+ log .Debug ("metrics are done" )
156156
157157 // He's dead, Jim.
158158 crowdsecTomb .Kill (nil )
@@ -164,27 +164,27 @@ func ShutdownCrowdsecRoutines() error {
164164}
165165
166166func shutdownAPI () error {
167- log .Debugf ("shutting down api via Tomb" )
167+ log .Debug ("shutting down api via Tomb" )
168168 apiTomb .Kill (nil )
169169
170170 if err := apiTomb .Wait (); err != nil {
171171 return err
172172 }
173173
174- log .Debugf ("done" )
174+ log .Debug ("done" )
175175
176176 return nil
177177}
178178
179179func shutdownCrowdsec () error {
180- log .Debugf ("shutting down crowdsec via Tomb" )
180+ log .Debug ("shutting down crowdsec via Tomb" )
181181 crowdsecTomb .Kill (nil )
182182
183183 if err := crowdsecTomb .Wait (); err != nil {
184184 return err
185185 }
186186
187- log .Debugf ("done" )
187+ log .Debug ("done" )
188188
189189 return nil
190190}
@@ -334,11 +334,11 @@ func Serve(ctx context.Context, cConfig *csconfig.Config, agentReady chan bool)
334334 return fmt .Errorf ("failed to init expr helpers: %w" , err )
335335 }
336336
337- log .Warningln ("Exprhelpers loaded without database client." )
337+ log .Warning ("Exprhelpers loaded without database client." )
338338 }
339339
340340 if cConfig .API .CTI != nil && cConfig .API .CTI .Enabled != nil && * cConfig .API .CTI .Enabled {
341- log .Infof ("Crowdsec CTI helper enabled" )
341+ log .Info ("Crowdsec CTI helper enabled" )
342342
343343 if err := ctiexpr .InitCrowdsecCTI (cConfig .API .CTI .Key , cConfig .API .CTI .CacheTimeout , cConfig .API .CTI .CacheSize , cConfig .API .CTI .LogLevel ); err != nil {
344344 return fmt .Errorf ("failed to init crowdsec cti: %w" , err )
@@ -347,11 +347,11 @@ func Serve(ctx context.Context, cConfig *csconfig.Config, agentReady chan bool)
347347
348348 if ! cConfig .DisableAPI {
349349 if cConfig .API .Server .OnlineClient == nil || cConfig .API .Server .OnlineClient .Credentials == nil {
350- log .Warningf ("Communication with CrowdSec Central API disabled from configuration file" )
350+ log .Warning ("Communication with CrowdSec Central API disabled from configuration file" )
351351 }
352352
353353 if flags .DisableCAPI {
354- log .Warningf ("Communication with CrowdSec Central API disabled from args" )
354+ log .Warning ("Communication with CrowdSec Central API disabled from args" )
355355
356356 cConfig .API .Server .OnlineClient = nil
357357 }
@@ -392,7 +392,7 @@ func Serve(ctx context.Context, cConfig *csconfig.Config, agentReady chan bool)
392392 }
393393
394394 if flags .TestMode {
395- log .Infof ("Configuration test done" )
395+ log .Info ("Configuration test done" )
396396 pluginBroker .Kill ()
397397
398398 return nil
@@ -424,9 +424,9 @@ func Serve(ctx context.Context, cConfig *csconfig.Config, agentReady chan bool)
424424
425425 switch ch {
426426 case apiTomb .Dead ():
427- log .Infof ("api shutdown" )
427+ log .Info ("api shutdown" )
428428 case crowdsecTomb .Dead ():
429- log .Infof ("crowdsec shutdown" )
429+ log .Info ("crowdsec shutdown" )
430430 }
431431 }
432432
0 commit comments