Documentation ¶
Index ¶
- Constants
- Variables
- type Backend
- type BackendType
- type Color
- type Data
- type Datum
- type JSONBackend
- type JSONBackendCfg
- type Level
- type Logger
- func (l *Logger) Child(domain string, data Data) *Logger
- func (l *Logger) Debug(level int, format string, args ...interface{})
- func (l *Logger) DebugData(data Data, level int, format string, args ...interface{})
- func (l *Logger) Error(format string, args ...interface{})
- func (l *Logger) ErrorData(data Data, format string, args ...interface{})
- func (l *Logger) Info(format string, args ...interface{})
- func (l *Logger) InfoData(data Data, format string, args ...interface{})
- func (l *Logger) Log(msg Message)
- func (l *Logger) StdLogger(level Level) *log.Logger
- func (l *Logger) Write(data []byte) (int, error)
- type LoggerCfg
- type Message
- type TerminalBackend
- type TerminalBackendCfg
Constants ¶
View Source
const ( DefaultTimestampKey = "time" DefaultTimestampLayout = time.RFC3339Nano DefaultDomainKey = "domain" DefaultLevelKey = "level" DefaultMessageKey = "msg" DefaultDataKey = "data" )
Variables ¶
Functions ¶
This section is empty.
Types ¶
type BackendType ¶
type BackendType string
const ( BackendTypeTerminal BackendType = "terminal" BackendTypeJSON BackendType = "json" )
type JSONBackend ¶
type JSONBackend struct {
Cfg JSONBackendCfg
}
func NewJSONBackend ¶
func NewJSONBackend(cfg JSONBackendCfg) *JSONBackend
func (*JSONBackend) Log ¶
func (b *JSONBackend) Log(msg Message)
type JSONBackendCfg ¶
type JSONBackendCfg struct { TimestampKey string `json:"timestamp_key,omitempty"` TimestampLayout string `json:"timestamp_layout,omitempty"` DomainKey string `json:"domain_key,omitempty"` LevelKey string `json:"level_key,omitempty"` MessageKey string `json:"message_key,omitempty"` DataKey string `json:"data_key,omitempty"` }
type LoggerCfg ¶
type LoggerCfg struct { BackendType BackendType `json:"backend_type"` TerminalBackend *TerminalBackendCfg `json:"terminal_backend,omitempty"` JSONBackend *JSONBackendCfg `json:"json_backend,omitempty"` DebugLevel int `json:"debug_level,omitempty"` }
type Message ¶
type TerminalBackend ¶
type TerminalBackend struct { Cfg TerminalBackendCfg // contains filtered or unexported fields }
func NewTerminalBackend ¶
func NewTerminalBackend(cfg TerminalBackendCfg) *TerminalBackend
func (*TerminalBackend) Log ¶
func (b *TerminalBackend) Log(msg Message)
type TerminalBackendCfg ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.