Files
moby/daemon/command/debug/debug.go
Sebastiaan van Stijn 69702bd821 fix minor linting issues
Making my IDE less noisy

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-15 22:30:38 +02:00

27 lines
504 B
Go

package debug
import (
"os"
"github.com/containerd/log"
)
// Enable sets the DEBUG env var to true
// and makes the logger to log at debug level.
func Enable() {
_ = os.Setenv("DEBUG", "1")
_ = log.SetLevel("debug")
}
// Disable sets the DEBUG env var to false
// and makes the logger to log at info level.
func Disable() {
_ = os.Unsetenv("DEBUG")
_ = log.SetLevel("info")
}
// IsEnabled checks whether the debug flag is set or not.
func IsEnabled() bool {
return os.Getenv("DEBUG") != ""
}