Documentation
¶
Index ¶
- Constants
- func IsTerminal() bool
- func NewContext(ctx context.Context, logger *Logger) context.Context
- func ToKlogLevel(level Level) int
- func ToLogSeverityLevel(level Level) string
- type DurationFormat
- type Level
- type Logger
- func (l *Logger) Debug(msg string, args ...any)
- func (l *Logger) Error(msg string, err error, args ...any)
- func (l *Logger) Info(msg string, args ...any)
- func (l *Logger) Level() Level
- func (l *Logger) Log(level Level, msg string, args ...any)
- func (l *Logger) Warn(msg string, args ...any)
- func (l *Logger) With(args ...any) *Logger
- func (l *Logger) WithGroup(name string) *Logger
Constants ¶
View Source
const ( InfoLevelSecurity = "info" DebugLevelSecurity = "debug" WarnLevelSecurity = "warn" ErrorLevelSecurity = "error" )
The following is Level security definitions.
Variables ¶
This section is empty.
Functions ¶
func IsTerminal ¶
func IsTerminal() bool
IsTerminal returns true if the given file descriptor is a terminal.
func NewContext ¶
NewContext returns a new context with the given logger.
func ToKlogLevel ¶
ToKlogLevel maps the current logging level to a Klog level integer
func ToLogSeverityLevel ¶
ToLogSeverityLevel maps the current logging level to a severity level string
Types ¶
type DurationFormat ¶
DurationFormat is the format used to print time.Duration in both nanosecond and string.
type Level ¶
Level is the logging level.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is a wrapper around slog.Handler.
Click to show internal directories.
Click to hide internal directories.