| OLD | NEW |
| 1 // Copyright 2015 The LUCI Authors. All rights reserved. | 1 // Copyright 2015 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
| 4 | 4 |
| 5 package main | 5 package main |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "bytes" | 8 "bytes" |
| 9 "flag" | 9 "flag" |
| 10 "fmt" | 10 "fmt" |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 Application: cli.Application{ | 230 Application: cli.Application{ |
| 231 Name: "butler", | 231 Name: "butler", |
| 232 Title: "Log collection and streaming bootstrap.", | 232 Title: "Log collection and streaming bootstrap.", |
| 233 Context: func(context.Context) context.Context { return
ctx }, | 233 Context: func(context.Context) context.Context { return
ctx }, |
| 234 Commands: []*subcommands.Command{ | 234 Commands: []*subcommands.Command{ |
| 235 subcommands.CmdHelp, | 235 subcommands.CmdHelp, |
| 236 subcommandRun, | 236 subcommandRun, |
| 237 subcommandStream, | 237 subcommandStream, |
| 238 subcommandServe, | 238 subcommandServe, |
| 239 | 239 |
| 240 » » » » authcli.SubcommandLogin(authOptions, "auth-login
"), | 240 » » » » authcli.SubcommandLogin(authOptions, "auth-login
", false), |
| 241 » » » » authcli.SubcommandLogout(authOptions, "auth-logo
ut"), | 241 » » » » authcli.SubcommandLogout(authOptions, "auth-logo
ut", false), |
| 242 » » » » authcli.SubcommandInfo(authOptions, "auth-info")
, | 242 » » » » authcli.SubcommandInfo(authOptions, "auth-info",
false), |
| 243 }, | 243 }, |
| 244 }, | 244 }, |
| 245 } | 245 } |
| 246 // Install logging configuration flags. | 246 // Install logging configuration flags. |
| 247 flags := flag.NewFlagSet("flags", flag.ExitOnError) | 247 flags := flag.NewFlagSet("flags", flag.ExitOnError) |
| 248 logConfig := log.Config{ | 248 logConfig := log.Config{ |
| 249 Level: log.Info, | 249 Level: log.Info, |
| 250 } | 250 } |
| 251 logConfig.AddFlags(flags) | 251 logConfig.AddFlags(flags) |
| 252 a.addFlags(flags) | 252 a.addFlags(flags) |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 | 333 |
| 334 paniccatcher.Do(func() { | 334 paniccatcher.Do(func() { |
| 335 rc = mainImpl(ctx, os.Args[1:]) | 335 rc = mainImpl(ctx, os.Args[1:]) |
| 336 }, func(p *paniccatcher.Panic) { | 336 }, func(p *paniccatcher.Panic) { |
| 337 log.Fields{ | 337 log.Fields{ |
| 338 "panic.error": p.Reason, | 338 "panic.error": p.Reason, |
| 339 }.Errorf(ctx, "Panic caught in main:\n%s", p.Stack) | 339 }.Errorf(ctx, "Panic caught in main:\n%s", p.Stack) |
| 340 rc = runtimeErrorReturnCode | 340 rc = runtimeErrorReturnCode |
| 341 }) | 341 }) |
| 342 } | 342 } |
| OLD | NEW |