mirror of
https://github.com/fleetdm/fleet
synced 2026-05-18 06:28:40 +00:00
15 lines
312 B
Go
15 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)
|
|
}
|
|
}
|