Documentation ¶
Index ¶
- type Config
- type ConsoleConfig
- type EchoMiddlewareLogger
- type LogLevel
- type LogMode
- type Logger
- type NOP
- func (nl NOP) Debug(args ...interface{})
- func (nl NOP) Debugf(format string, args ...interface{})
- func (nl NOP) Error(args ...interface{})
- func (nl NOP) Errorf(format string, args ...interface{})
- func (nl NOP) Fatal(args ...interface{})
- func (nl NOP) Fatalf(format string, args ...interface{})
- func (nl NOP) Info(args ...interface{})
- func (nl NOP) Infof(format string, args ...interface{})
- func (nl NOP) Warn(args ...interface{})
- func (nl NOP) Warnf(format string, args ...interface{})
- func (nl NOP) WithPrefix(name string) Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Mode LogMode Console ConsoleConfig }
Config represent high-level logger configuration.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig provides ready to use configuration for development mode. It is configured to support only console output with Debug logging level.
type ConsoleConfig ¶
ConsoleConfig groups configuration bits
type EchoMiddlewareLogger ¶
type EchoMiddlewareLogger struct { DebugOnly bool // contains filtered or unexported fields }
EchoMiddlewareLogger is Echo Middleware compatible adapter.
func NewEchoMiddlewareLogger ¶
func NewEchoMiddlewareLogger(lgr Logger) *EchoMiddlewareLogger
NewEchoMiddlewareLogger serve as adaptation layer to convert application logger to be compatible with echo framework middleware logging logic.
type LogLevel ¶
type LogLevel string
LogLevel represent different depths for logged informations about the system.
const ( // Debug level logging, should be disabled in production mode. Debug LogLevel = "debug" // Info level logging, default logging setting Info LogLevel = "info" // Warn level logging used to mark possible issues in code execution. // For convenience "warn" spelling is also accepted. Warn LogLevel = "warning" // Error level logging logs errors Error LogLevel = "error" // Fatal level logging, log is recorded and application terminates after. Fatal LogLevel = "fatal" )
type Logger ¶
type Logger interface { Debug(args ...interface{}) Debugf(format string, args ...interface{}) Info(args ...interface{}) Infof(format string, args ...interface{}) Warn(args ...interface{}) Warnf(format string, args ...interface{}) Error(args ...interface{}) Errorf(format string, args ...interface{}) Fatal(args ...interface{}) Fatalf(format string, args ...interface{}) WithPrefix(pfx string) Logger }
logger interface describes logging abstraction layer.
type NOP ¶
type NOP struct{}
NOP provide no-ops implementation for Logger interface.
func (NOP) WithPrefix ¶
Click to show internal directories.
Click to hide internal directories.