New 🌊 wave for @helm

Commit b7940b5f

b7940b5f9f0dMerged

zhilyaev <[email protected]> · 5 years ago · 9 files · ~9 modified

Description

logs flags fix

Details

Commit
b7940b5f9f0d
Parent
5356330459ec

cmd/helmwave/flags_log.gomodifiedView file

@@ -1,37 +1,36 @@
11 package main
22
3-import (
4- "github.com/urfave/cli/v2"
5-)
6-
3+import "github.com/urfave/cli/v2"
74
8-var flagsLog = []cli.Flag{
9- &cli.StringFlag{
10- Name: "log-format",
11- Usage: "You can set: [ text | json | pad | emoji ]",
12- Value: "emoji",
13- EnvVars: []string{"HELMWAVE_LOG_FORMAT"},
14- Destination: &app.Logger.Format,
15- },
16- &cli.StringFlag{
17- Name: "log-level",
18- Usage: "You can set: [ debug | info | warn | fatal | panic | trace ]",
19- Value: "info",
20- EnvVars: []string{"HELMWAVE_LOG_LEVEL", "HELMWAVE_LOG_LVL"},
21- Destination: &app.Logger.Level,
22- },
23- &cli.BoolFlag{
24- Name: "log-color",
25- Usage: "Force color",
26- Value: true,
27- EnvVars: []string{"HELMWAVE_LOG_COLOR"},
28- Destination: &app.Logger.Color,
29- },
30- &cli.IntFlag{
31- Name: "kubedog-log-width",
32- Usage: "Set kubedog max log line width",
33- Value: 140,
34- EnvVars: []string{"HELMWAVE_KUBEDOG_LOG_WIDTH"},
35- Destination: &app.Logger.Width,
36- },
37-}
5+func flagsLog() []cli.Flag {
6+ return []cli.Flag{
7+ &cli.StringFlag{
8+ Name: "log-format",
9+ Usage: "You can set: [ text | json | pad | emoji ]",
10+ Value: "emoji",
11+ EnvVars: []string{"HELMWAVE_LOG_FORMAT"},
12+ Destination: &app.Logger.Format,
13+ },
14+ &cli.StringFlag{
15+ Name: "log-level",
16+ Usage: "You can set: [ debug | info | warn | fatal | panic | trace ]",
17+ Value: "info",
18+ EnvVars: []string{"HELMWAVE_LOG_LEVEL", "HELMWAVE_LOG_LVL"},
19+ Destination: &app.Logger.Level,
20+ },
21+ &cli.BoolFlag{
22+ Name: "log-color",
23+ Usage: "Force color",
24+ Value: true,
25+ EnvVars: []string{"HELMWAVE_LOG_COLOR"},
26+ Destination: &app.Logger.Color,
27+ },
28+ &cli.IntFlag{
29+ Name: "kubedog-log-width",
30+ Usage: "Set kubedog max log line width",
31+ Value: 140,
32+ EnvVars: []string{"HELMWAVE_KUBEDOG_LOG_WIDTH"},
33+ Destination: &app.Logger.Width,
34+ },
35+ }
36+}