Documentation
¶
Index ¶
- Constants
- func RegisterLogWriter(lw LogWriter)
- type LogEntry
- func Log(level LogLevel, message string, fields ...interface{}) LogEntry
- func LogDebug(message string, fields ...interface{}) LogEntry
- func LogError(message string, fields ...interface{}) LogEntry
- func LogInfo(message string, fields ...interface{}) LogEntry
- func LogWarning(message string, fields ...interface{}) LogEntry
- func (l LogEntry) Attributes() []interface{}
- func (l LogEntry) Fields() map[string]interface{}
- func (l LogEntry) Level() string
- func (l LogEntry) Message() string
- func (l LogEntry) SetAttribute(name string, value interface{}) LogEntry
- func (l LogEntry) SetField(name string, value interface{}) LogEntry
- func (l LogEntry) Write()
- func (l LogEntry) WriteTo(w io.Writer)
- type LogLevel
- type LogWriter
- type Logger
Constants ¶
View Source
const Warning = Warn
Variables ¶
This section is empty.
Functions ¶
func RegisterLogWriter ¶
func RegisterLogWriter(lw LogWriter)
RegisterLogWriter register the log writers where the log line will be propagated.
Types ¶
type LogEntry ¶
type LogEntry struct {
// contains filtered or unexported fields
}
LogEntry is the log line that will be sent to the default log channel.
func LogWarning ¶
LogWarning creates a new log entry with `level` warning
func (LogEntry) Attributes ¶
func (l LogEntry) Attributes() []interface{}
func (LogEntry) SetAttribute ¶
type LogWriter ¶
type LogWriter interface {
// WriteLogLine receives a JSON string without the ending \n
WriteLogLine(string)
}
LogWriter interface to implement to make a log writer.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is a logging facility with fixed fields written in every log line
func NewLogger ¶
func NewLogger(fields ...interface{}) *Logger
NewLogger creates a new Logger with fixed fields
func (*Logger) AddFields ¶
func (l *Logger) AddFields(fields ...interface{})
AddFields appends a new fixed field to Logger
Click to show internal directories.
Click to hide internal directories.