grim/convey

9b88105145ca
Parents 2b2135d540db
Children b0a62de6249f
Initialize logging before loading the config
  • +7 -7
    main.go
  • --- a/main.go Sat Jan 06 23:32:30 2018 -0600
    +++ b/main.go Sat Jan 06 23:47:59 2018 -0600
    @@ -72,6 +72,13 @@
    func gomain() int {
    app.Parse(os.Args[1:])
    + // setup logging
    + if err := logging.Setup(*color, *verbose); err != nil {
    + fmt.Printf("failed to setup logging: %s\n", err)
    + return 1
    + }
    + defer gomol.ShutdownLoggers()
    +
    // now load the config
    var loader config.Loader
    switch *configLoader {
    @@ -112,13 +119,6 @@
    return 1
    }
    - // setup logging
    - if err := logging.Setup(*color, *verbose); err != nil {
    - fmt.Printf("failed to setup logging: %s\n", err)
    - return 1
    - }
    - defer gomol.ShutdownLoggers()
    -
    // find our default environment variables and then update them with the
    // values from the command line
    defEnv, err := environment.Initialize(cfgPath)