Chromium Code Reviews| Index: cipd/client/cli/main.go |
| diff --git a/cipd/client/cli/main.go b/cipd/client/cli/main.go |
| index b0e421673cbe352b56f110e3a08433c9d1da37db..30e7f9fc35f7609f19ec1280c7e39317660119f0 100644 |
| --- a/cipd/client/cli/main.go |
| +++ b/cipd/client/cli/main.go |
| @@ -91,20 +91,27 @@ type cipdSubcommand struct { |
| jsonOutput string |
| verbose bool |
| + logConfig logging.Config |
| } |
| // ModifyContext implements cli.ContextModificator. |
| func (c *cipdSubcommand) ModifyContext(ctx context.Context) context.Context { |
| if c.verbose { |
| ctx = logging.SetLevel(ctx, logging.Debug) |
| + } else { |
| + ctx = c.logConfig.Set(ctx) |
| } |
| return ctx |
| } |
| // registerBaseFlags registers common flags used by all subcommands. |
| func (c *cipdSubcommand) registerBaseFlags() { |
| + // Set the default log level. |
| + c.logConfig.Level = logging.Info |
| + |
| c.Flags.StringVar(&c.jsonOutput, "json-output", "", "Path to write operation results to.") |
| - c.Flags.BoolVar(&c.verbose, "verbose", false, "Enable more logging.") |
| + c.Flags.BoolVar(&c.verbose, "verbose", false, "Enable debug-level logging.") |
|
Vadim Sh.
2017/07/26 03:47:44
I think we can kill this flag. No scripts is using
dnj
2017/07/26 05:46:37
I suppose since we pin CIPD, this is a relatively
|
| + c.logConfig.AddFlags(&c.Flags) |
| } |
| // checkArgs checks command line args. |