Documentation ¶
Index ¶
- Constants
- func Debug(message string, keyvals ...interface{})
- func Error(message string, keyvals ...interface{})
- func Info(message string, keyvals ...interface{})
- func NewZapLogger(logLevel string) (*zap.Logger, error)
- func SetLevel(level string)
- func Warning(message string, keyvals ...interface{})
- type Log
- func (l Log) Debug(message string, keyvals ...interface{})
- func (l Log) Error(message string, keyvals ...interface{})
- func (l Log) Info(message string, keyvals ...interface{})
- func (l Log) Log(keyvals ...interface{})
- func (l Log) SetLevel(logLevel string)
- func (l Log) Warning(message string, keyvals ...interface{})
- func (l Log) With(keyvals ...interface{}) Log
- func (l Log) WithTrace(ctx context.Context) Log
- type Logger
Constants ¶
View Source
const ( LevelDebug = "debug" LevelInfo = "info" LevelWarning = "warning" LevelError = "error" MessageKey = "message" EnvironmentVariable = "LOG_LEVEL" )
Variables ¶
This section is empty.
Functions ¶
func NewZapLogger ¶
SetupZapLogger will setup a zap-logger with the given level.
Types ¶
type Log ¶
type Log struct {
// contains filtered or unexported fields
}
func NewLogger ¶
NewLogger creates a new, leveled Log. The given level is the allowed minimal level.
func NewLoggerFromEnv ¶
func NewLoggerFromEnv() Log
NewLoggerFromEnv creates a new Log, configuring the log level using an environment variable.
type Logger ¶
type Logger interface { Log(keyvals ...interface{}) Debug(message string, keyvals ...interface{}) Info(message string, keyvals ...interface{}) Warning(message string, keyvals ...interface{}) Error(message string, keyvals ...interface{}) With(keyvals ...interface{}) Log WithTrace(ctx context.Context) Log }
Logger is the default logging interface which is used throughout all godin services.
Click to show internal directories.
Click to hide internal directories.