Documentation ¶
Overview ¶
Package logger provides default logger for quark-go framework. Logger is based on "github.com/Sirupsen/logrus" library.
Index ¶
- func SetInternalLogger(l Logger)
- type Fields
- type Level
- type Logger
- type LogrusLogger
- func (logger LogrusLogger) Debug(args ...interface{})
- func (logger LogrusLogger) DebugWithFields(fields Fields, args ...interface{})
- func (logger LogrusLogger) Error(args ...interface{})
- func (logger LogrusLogger) ErrorWithFields(fields Fields, args ...interface{})
- func (logger LogrusLogger) Fatal(args ...interface{})
- func (logger LogrusLogger) FatalWithFields(fields Fields, args ...interface{})
- func (logger LogrusLogger) Info(args ...interface{})
- func (logger LogrusLogger) InfoWithFields(fields Fields, args ...interface{})
- func (logger LogrusLogger) IsLevel(level Level) bool
- func (logger LogrusLogger) Panic(args ...interface{})
- func (logger LogrusLogger) PanicWithFields(fields Fields, args ...interface{})
- func (logger LogrusLogger) SetLevel(level Level)
- func (logger LogrusLogger) Warning(args ...interface{})
- func (logger LogrusLogger) WarningWithFields(fields Fields, args ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetInternalLogger ¶
func SetInternalLogger(l Logger)
SetInternalLogger sets logger for quark-go framework internal logging. Internal logger is required and default implementation is base on "github.com/Sirupsen/logrus" library.
Types ¶
type Fields ¶
type Fields map[string]interface{}
Fields represents map between log parameter name and value.
type Level ¶
type Level uint8
Level represents logging level.
const ( // PanicLevel represents Panic logging level. PanicLevel Level = iota // FatalLevel represents Fatal logging level. FatalLevel // ErrorLevel represents Error logging level. ErrorLevel // WarningLevel represents Warning logging level. WarningLevel // InfoLevel represents Panic Info level. InfoLevel // DebugLevel represents Debug logging level. DebugLevel )
type Logger ¶
type Logger interface { Panic(args ...interface{}) PanicWithFields(fields Fields, args ...interface{}) Fatal(args ...interface{}) FatalWithFields(fields Fields, args ...interface{}) Error(args ...interface{}) ErrorWithFields(fields Fields, args ...interface{}) Warning(args ...interface{}) WarningWithFields(fields Fields, args ...interface{}) Info(args ...interface{}) InfoWithFields(fields Fields, args ...interface{}) Debug(args ...interface{}) DebugWithFields(fields Fields, args ...interface{}) SetLevel(level Level) IsLevel(level Level) bool }
Logger represents logging mechanism.
type LogrusLogger ¶
type LogrusLogger struct { }
LogrusLogger represents loging mechanism based on "github.com/Sirupsen/logrus" library.
func (LogrusLogger) Debug ¶
func (logger LogrusLogger) Debug(args ...interface{})
Debug logs debug level message.
func (LogrusLogger) DebugWithFields ¶
func (logger LogrusLogger) DebugWithFields(fields Fields, args ...interface{})
DebugWithFields log debug level message with custom fields.
func (LogrusLogger) Error ¶
func (logger LogrusLogger) Error(args ...interface{})
Error logs error level message.
func (LogrusLogger) ErrorWithFields ¶
func (logger LogrusLogger) ErrorWithFields(fields Fields, args ...interface{})
ErrorWithFields logs error level message with custom fields.
func (LogrusLogger) Fatal ¶
func (logger LogrusLogger) Fatal(args ...interface{})
Fatal logs message and calls exit(1).
func (LogrusLogger) FatalWithFields ¶
func (logger LogrusLogger) FatalWithFields(fields Fields, args ...interface{})
FatalWithFields logs message with custom fields and calls exit(1).
func (LogrusLogger) Info ¶
func (logger LogrusLogger) Info(args ...interface{})
Info logs info level message.
func (LogrusLogger) InfoWithFields ¶
func (logger LogrusLogger) InfoWithFields(fields Fields, args ...interface{})
InfoWithFields logs info level message with custom fields.
func (LogrusLogger) IsLevel ¶
func (logger LogrusLogger) IsLevel(level Level) bool
IsLevel returs true if log level specified in parameter matches log level currently sets on logger.
func (LogrusLogger) Panic ¶
func (logger LogrusLogger) Panic(args ...interface{})
Panic logs message and panics.
func (LogrusLogger) PanicWithFields ¶
func (logger LogrusLogger) PanicWithFields(fields Fields, args ...interface{})
PanicWithFields logs message with custom fields and panic.
func (LogrusLogger) SetLevel ¶
func (logger LogrusLogger) SetLevel(level Level)
SetLevel sets logging level.
func (LogrusLogger) Warning ¶
func (logger LogrusLogger) Warning(args ...interface{})
Warning logs warning level message.
func (LogrusLogger) WarningWithFields ¶
func (logger LogrusLogger) WarningWithFields(fields Fields, args ...interface{})
WarningWithFields logs warning level message with custom fields.