Skip to content

Commit f55b9e9

Browse files
committed
Write out parse errors for the initial logging config.
1 parent bab6064 commit f55b9e9

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

cmd/supercommand.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package cmd
22

33
import (
4+
"fmt"
45
"os"
56

67
"github.com/juju/cmd"
@@ -11,10 +12,12 @@ import (
1112
)
1213

1314
func init() {
14-
// Ignore any parse errors that the configuration may have.
15-
// This is a developer feature, and if it isn't working, then it
16-
// is probably due to the configuration being wrong.
17-
loggo.ConfigureLoggers(os.Getenv(osenv.JujuStartupLoggingConfigEnvKey))
15+
// If the environment key is empty, ConfigureLoggers returns nil and does
16+
// nothing.
17+
err := loggo.ConfigureLoggers(os.Getenv(osenv.JujuStartupLoggingConfigEnvKey))
18+
if err != nil {
19+
fmt.Fprintf(os.Stderr, "ERROR parsing %s: %s\n\n", osenv.JujuStartupLoggingConfigEnvKey, err)
20+
}
1821
}
1922

2023
var logger = loggo.GetLogger("juju.cmd")

0 commit comments

Comments
 (0)