MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / Deprecated

Function Deprecated

logger/logger.go:70–85  ·  view source on GitHub ↗

Deprecated prints a deprecation warning message. If the IMGPROXY_FAIL_ON_DEPRECATION environment variable is truthy, it prints an error message and exits the program.

(deprecation, replacement string, additional ...string)

Source from the content-addressed store, hash-verified

68// If the IMGPROXY_FAIL_ON_DEPRECATION environment variable is truthy,
69// it prints an error message and exits the program.
70func Deprecated(deprecation, replacement string, additional ...string) {
71 msg := fmt.Sprintf("%s is deprecated, use %s instead", deprecation, replacement)
72
73 if len(additional) > 0 {
74 msg += ". " + strings.Join(additional, ". ")
75 }
76
77 shouldFail := false
78 IMGPROXY_FAIL_ON_DEPRECATION.Parse(&shouldFail)
79
80 if shouldFail {
81 Fatal(msg)
82 } else {
83 slog.Warn(msg)
84 }
85}
86
87// Mute sets the default logger to a discard logger muting all log output
88func Mute() {

Callers

nothing calls this directly

Calls 3

FatalFunction · 0.85
ParseMethod · 0.80
WarnMethod · 0.80

Tested by

no test coverage detected