Skip to content

Commit ae0ecc7

Browse files
committed
unnecessary formatting methods
1 parent 075f25c commit ae0ecc7

File tree

7 files changed

+32
-32
lines changed

7 files changed

+32
-32
lines changed

cmd/crowdsec/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func serveAPIServer(ctx context.Context, apiServer *apiserver.APIServer) {
5959

6060
<-apiTomb.Dying() // lock until go routine is dying
6161
pluginTomb.Kill(nil)
62-
log.Infof("serve: shutting down api server")
62+
log.Info("serve: shutting down api server")
6363

6464
return apiServer.Shutdown(ctx)
6565
})

cmd/crowdsec/crowdsec.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func startBucketRoutines(cConfig *csconfig.Config) {
117117
}
118118

119119
func startHeartBeat(ctx context.Context, _ *csconfig.Config, apiClient *apiclient.ApiClient) {
120-
log.Debugf("Starting HeartBeat service")
120+
log.Debug("Starting HeartBeat service")
121121
apiClient.HeartBeat.StartHeartBeat(ctx, &outputsTomb)
122122
}
123123

@@ -223,13 +223,13 @@ func serveCrowdsec(ctx context.Context, parsers *parser.Parsers, cConfig *csconf
223223
- acquisTomb is dead, it means that we were in "cat" mode and files are done reading, quit
224224
*/
225225
waitOnTomb()
226-
log.Debugf("Shutting down crowdsec routines")
226+
log.Debug("Shutting down crowdsec routines")
227227

228228
if err := ShutdownCrowdsecRoutines(); err != nil {
229229
return fmt.Errorf("unable to shutdown crowdsec routines: %w", err)
230230
}
231231

232-
log.Debugf("everything is dead, return crowdsecTomb")
232+
log.Debug("everything is dead, return crowdsecTomb")
233233

234234
if dumpStates {
235235
if err := dumpAllStates(); err != nil {
@@ -267,7 +267,7 @@ func waitOnTomb() {
267267
return
268268

269269
case <-crowdsecTomb.Dying():
270-
log.Infof("Crowdsec engine shutting down")
270+
log.Info("Crowdsec engine shutting down")
271271
return
272272
}
273273
}

cmd/crowdsec/output.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,12 @@ func runOutput(
134134
}
135135

136136
if ov.Reprocess {
137-
log.Debugf("Overflow being reprocessed.")
137+
log.Debug("Overflow being reprocessed.")
138138
select {
139139
case input <- event:
140-
log.Debugf("reprocessing overflow event")
140+
log.Debug("reprocessing overflow event")
141141
case <-parsersTomb.Dead():
142-
log.Debugf("parsing is dead, skipping")
142+
log.Debug("parsing is dead, skipping")
143143
}
144144
}
145145

cmd/crowdsec/parse.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func parseEvent(
5252

5353
metrics.GlobalParserHitsOk.With(prometheus.Labels{"source": event.Line.Src, "type": event.Line.Module, "acquis_type": event.Line.Labels["type"]}).Inc()
5454
if parsed.Whitelisted {
55-
log.Debugf("event whitelisted, discard")
55+
log.Debug("event whitelisted, discard")
5656
return nil
5757
}
5858

@@ -63,7 +63,7 @@ func runParse(input chan pipeline.Event, output chan pipeline.Event, parserCTX p
6363
for {
6464
select {
6565
case <-parsersTomb.Dying():
66-
log.Infof("Killing parser routines")
66+
log.Info("Killing parser routines")
6767
return nil
6868
case event := <-input:
6969
parsed := parseEvent(event, parserCTX, nodes)

cmd/crowdsec/pour.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func runPour(input chan pipeline.Event, holders []leaky.BucketFactory, buckets *
4343
// bucket is now ready
4444
select {
4545
case <-bucketsTomb.Dying():
46-
log.Infof("Bucket routine exiting")
46+
log.Info("Bucket routine exiting")
4747
return nil
4848
case parsed := <-input:
4949
startTime := time.Now()

cmd/crowdsec/serve.go

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -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) {
9090
func 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

166166
func 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

179179
func 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

cmd/crowdsec/win_service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func runService(name string) error {
7272
if err != nil {
7373
if errno, ok := err.(syscall.Errno); ok { //nolint:errorlint
7474
if errno == windows.ERROR_ACCESS_DENIED {
75-
log.Warnf("Access denied when installing event source, running as non-admin ?")
75+
log.Warn("Access denied when installing event source, running as non-admin?")
7676
} else {
7777
log.Warnf("Failed to install event log: %s (%d)", err, errno)
7878
}

0 commit comments

Comments
 (0)