Documentation ¶
Index ¶
- Constants
- Variables
- type BaseLogTarget
- type FileLogTarget
- type Logger
- func (l *Logger) AddTarget(target *Target)
- func (l *Logger) Critical(data interface{}, extraData map[string]interface{}, category string)
- func (l *Logger) Debug(data interface{}, extraData map[string]interface{}, category string)
- func (l *Logger) Error(data interface{}, extraData map[string]interface{}, category string)
- func (l *Logger) Info(data interface{}, extraData map[string]interface{}, category string)
- func (l *Logger) Log(data interface{}, extraData map[string]interface{}, level string, ...)
- func (l *Logger) Warning(data interface{}, extraData map[string]interface{}, category string)
- type Message
- func (l *Message) AddExceptTarget(key int)
- func (l *Message) AddPrevious(message MessageData)
- func (l *Message) Category() string
- func (l *Message) Data() interface{}
- func (l *Message) Except() []int
- func (l *Message) ExtraData() map[string]interface{}
- func (l *Message) Level() string
- func (l *Message) Previous() []MessageData
- type MessageData
- type PrintLogTarget
- type Target
Constants ¶
View Source
const LevelCritical = "critical"
View Source
const LevelDebug = "debug"
View Source
const LevelError = "error"
View Source
const LevelInfo = "info"
View Source
const LevelWarning = "warning"
Variables ¶
View Source
var LogsQueueName string
Functions ¶
This section is empty.
Types ¶
type BaseLogTarget ¶
func (*BaseLogTarget) CanLog ¶
func (t *BaseLogTarget) CanLog(message MessageData) bool
type FileLogTarget ¶
type FileLogTarget struct { BaseLogTarget FilePath string MaxSize int MaxBackups int }
func (*FileLogTarget) Log ¶
func (t *FileLogTarget) Log(message MessageData) error
type Logger ¶
type Logger struct {
Targets []Target
}
Logger TODO add FlushInterval and batch logging
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
func (*Message) AddExceptTarget ¶
func (*Message) AddPrevious ¶
func (l *Message) AddPrevious(message MessageData)
func (*Message) Previous ¶
func (l *Message) Previous() []MessageData
type MessageData ¶
type MessageData interface { Data() interface{} ExtraData() map[string]interface{} Level() string Category() string Except() []int AddExceptTarget(key int) Previous() []MessageData AddPrevious(MessageData) }
type PrintLogTarget ¶
type PrintLogTarget struct {
BaseLogTarget
}
func (*PrintLogTarget) Log ¶
func (l *PrintLogTarget) Log(message MessageData) error
type Target ¶
type Target interface { Log(message MessageData) error CanLog(message MessageData) bool }
func CreateFileLogTarget ¶
func CreatePrintLogTarget ¶
Click to show internal directories.
Click to hide internal directories.