mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 17:05:18 +00:00
16 lines
312 B
Go
16 lines
312 B
Go
package logging
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/rs/zerolog/log"
|
|
)
|
|
|
|
// LogErrIfEnvNotSet logs if the environment variable is not set to "1".
|
|
func LogErrIfEnvNotSet(envVarName string, err error, message string) {
|
|
actualValue := os.Getenv(envVarName)
|
|
if actualValue != "1" {
|
|
log.Info().Err(err).Msg(message)
|
|
}
|
|
}
|