Skip to content

Commit

Permalink
log error from flag assignment from env vars to standard errros (#365)
Browse files Browse the repository at this point in the history
* ensure errors from env variable flag assignments are logged to standard error and fix tests

* revert tests
  • Loading branch information
sami-alajrami authored Oct 21, 2024
1 parent f29f037 commit 9922e31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/kosli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ func initialize(cmd *cobra.Command, out io.Writer) error {
func bindFlags(cmd *cobra.Command, v *viper.Viper) {
// for some reason, logger does not print errors at the point
// of calling this function, so we ensure to point errors to stderr
logger.SetErrOut(cmd.ErrOrStderr())
logger.SetErrOut(os.Stderr)
// api token in config file is encrypted, so we have to decrypt it
// but if it is set via env variables, it is not encrypted
_, apiTokenSetInEnv := os.LookupEnv("KOSLI_API_TOKEN")
Expand Down

0 comments on commit 9922e31

Please sign in to comment.