File tree 3 files changed +5
-6
lines changed
3 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -26,14 +26,14 @@ type Format struct {
26
26
Stdin bool `help:"Format the context passed in via stdin"`
27
27
}
28
28
29
- func ( f * Format ) Configure () {
29
+ func ConfigureLogging () {
30
30
log .SetReportTimestamp (false )
31
31
32
- if f .Verbosity == 0 {
32
+ if Cli .Verbosity == 0 {
33
33
log .SetLevel (log .WarnLevel )
34
- } else if f .Verbosity == 1 {
34
+ } else if Cli .Verbosity == 1 {
35
35
log .SetLevel (log .InfoLevel )
36
- } else if f .Verbosity > 1 {
36
+ } else if Cli .Verbosity > 1 {
37
37
log .SetLevel (log .DebugLevel )
38
38
}
39
39
}
Original file line number Diff line number Diff line change 43
43
func (f * Format ) Run () (err error ) {
44
44
stats .Init ()
45
45
46
- Cli .Configure ()
47
-
48
46
l := log .WithPrefix ("format" )
49
47
50
48
defer func () {
Original file line number Diff line number Diff line change @@ -36,5 +36,6 @@ func main() {
36
36
}
37
37
38
38
ctx := kong .Parse (& cli .Cli )
39
+ cli .ConfigureLogging ()
39
40
ctx .FatalIfErrorf (ctx .Run ())
40
41
}
You can’t perform that action at this time.
0 commit comments