mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-07-04 17:06:49 +00:00
Moved v3 code from NginxProxyManager/nginx-proxy-manager-3 to NginxProxyManager/nginx-proxy-manager
This commit is contained in:
40
backend/internal/logger/config.go
Normal file
40
backend/internal/logger/config.go
Normal file
@ -0,0 +1,40 @@
|
||||
package logger
|
||||
|
||||
import "github.com/getsentry/sentry-go"
|
||||
|
||||
// Level type
|
||||
type Level int
|
||||
|
||||
// Log level definitions
|
||||
const (
|
||||
// DebugLevel usually only enabled when debugging. Very verbose logging.
|
||||
DebugLevel Level = 10
|
||||
// InfoLevel general operational entries about what's going on inside the application.
|
||||
InfoLevel Level = 20
|
||||
// WarnLevel non-critical entries that deserve eyes.
|
||||
WarnLevel Level = 30
|
||||
// ErrorLevel used for errors that should definitely be noted.
|
||||
ErrorLevel Level = 40
|
||||
)
|
||||
|
||||
// Config options for the logger.
|
||||
type Config struct {
|
||||
LogThreshold Level
|
||||
Formatter string
|
||||
SentryConfig sentry.ClientOptions
|
||||
}
|
||||
|
||||
// Interface for a logger
|
||||
type Interface interface {
|
||||
GetLogLevel() Level
|
||||
Debug(format string, args ...interface{})
|
||||
Info(format string, args ...interface{})
|
||||
Warn(format string, args ...interface{})
|
||||
Error(errorClass string, err error, args ...interface{})
|
||||
Errorf(errorClass, format string, err error, args ...interface{})
|
||||
}
|
||||
|
||||
// ConfigurableLogger is an interface for a logger that can be configured
|
||||
type ConfigurableLogger interface {
|
||||
Configure(c *Config) error
|
||||
}
|
Reference in New Issue
Block a user