File tree 1 file changed +8
-1
lines changed
cmd/security-profiles-operator
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import (
26
26
_ "net/http/pprof" //nolint:gosec // required for profiling
27
27
"os"
28
28
"os/exec"
29
+ "strconv"
29
30
"strings"
30
31
"time"
31
32
@@ -283,7 +284,8 @@ func initialize(ctx *cli.Context) error {
283
284
}
284
285
285
286
func initLogging (ctx * cli.Context ) error {
286
- ctrl .SetLogger (textlogger .NewLogger (textlogger .NewConfig ()))
287
+ logConfig := textlogger .NewConfig ()
288
+ ctrl .SetLogger (textlogger .NewLogger (logConfig ))
287
289
288
290
set := flag .NewFlagSet ("logging" , flag .ContinueOnError )
289
291
klog .InitFlags (set )
@@ -294,6 +296,11 @@ func initLogging(ctx *cli.Context) error {
294
296
}
295
297
296
298
ctrl .SetLogger (ctrl .Log .V (int (level )))
299
+
300
+ if err := logConfig .Verbosity ().Set (strconv .FormatUint (uint64 (level ), 10 )); err != nil {
301
+ return fmt .Errorf ("setting the verbosity flag to level %d : %w" , level , err )
302
+ }
303
+
297
304
ctrl .Log .Info (fmt .Sprintf ("Set logging verbosity to %d" , level ))
298
305
299
306
return nil
You can’t perform that action at this time.
0 commit comments