Documentation ¶
Index ¶
- Constants
- type Caller
- type JsonLog
- type Logger
- type Loki
- func (l *Loki) Debug(mesg string, args ...interface{})
- func (l *Loki) Error(mesg string, args ...interface{})
- func (l *Loki) Fatal(mesg string, args ...interface{})
- func (l *Loki) Info(mesg string, args ...interface{})
- func (l *Loki) Set(level int)
- func (l *Loki) Warn(mesg string, args ...interface{})
- func (l *Loki) WriteFile(path string) error
- type LokiJson
- func (l *LokiJson) Debug(mesg string, args ...interface{})
- func (l *LokiJson) Error(mesg string, args ...interface{})
- func (l *LokiJson) Fatal(mesg string, args ...interface{})
- func (l *LokiJson) Info(mesg string, args ...interface{})
- func (l *LokiJson) Set(level int)
- func (l *LokiJson) Warn(mesg string, args ...interface{})
- func (l *LokiJson) WriteFile(path string) error
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Caller ¶
type Caller struct { Function string `json:"function"` Line int `json:"line"` File string `json:"file"` }
Caller defines json structure to store data on where the log message orginated
type JsonLog ¶
type JsonLog struct { Timestamp time.Time `json:"timestamp"` Message string `json:"message"` Error error `json:"error,omitempty"` Level string `json:"level"` Caller Caller `json:"caller"` Context []*json.RawMessage `json:"context,omitempty"` }
JsonLog struct defines the structure of a log message
type Logger ¶
type Logger interface { Set(int) WriteFile(string) error Debug(string, ...interface{}) Info(string, ...interface{}) Warn(string, ...interface{}) Error(string, ...interface{}) Fatal(string, ...interface{}) }
Logger is base interface for different loggers
type Loki ¶
type Loki struct {
// contains filtered or unexported fields
}
Loki basic logger
type LokiJson ¶
type LokiJson struct {
// contains filtered or unexported fields
}
LokiJson logs in json format
func NewJsonLogger ¶
func NewJsonLogger() *LokiJson
NewJsonLogger return a new loki logger that logs in json format. By default writes to stdout
Click to show internal directories.
Click to hide internal directories.