Documentation ¶
Index ¶
- Constants
- type ContextualLog
- func (c *ContextualLog) Error(msg string) *ContextualLog
- func (c *ContextualLog) Errorf(format string, v ...interface{}) *ContextualLog
- func (c *ContextualLog) Fatal(msg string) *ContextualLog
- func (c *ContextualLog) Fatalf(format string, v ...interface{}) *ContextualLog
- func (c *ContextualLog) Info(msg string) *ContextualLog
- func (c *ContextualLog) Infof(format string, v ...interface{}) *ContextualLog
- func (c *ContextualLog) Measure()
- func (c *ContextualLog) Meta(kv ...KeyValue) *ContextualLog
- func (c *ContextualLog) NewContextual(name string) *ContextualLog
- func (c *ContextualLog) Warn(msg string) *ContextualLog
- func (c *ContextualLog) Warnf(format string, v ...interface{}) *ContextualLog
- type KeyValue
- type Log
- func (l *Log) Debug(msg string) *Log
- func (l *Log) Debugf(format string, v ...interface{}) *Log
- func (l *Log) Error(msg string) *Log
- func (l *Log) Errorf(format string, v ...interface{}) *Log
- func (l *Log) Fatal(msg string) *Log
- func (l *Log) Fatalf(format string, v ...interface{}) *Log
- func (l *Log) Info(msg string) *Log
- func (l *Log) Infof(format string, v ...interface{}) *Log
- func (l *Log) Warn(msg string) *Log
- func (l *Log) Warnf(format string, v ...interface{}) *Log
- type Logger
- type Option
- type Optional
Constants ¶
const ( // LevelDebug . LevelDebug = iota // LevelInfo . LevelInfo // LevelWarn . LevelWarn // LevelError . LevelError // LevelFatal . LevelFatal )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContextualLog ¶
type ContextualLog struct {
// contains filtered or unexported fields
}
ContextualLog is main object for contextual logging
func Contextual ¶
func Contextual(adapter Logger, name string) *ContextualLog
Contextual used to create new instance of ContextualLog
func (*ContextualLog) Error ¶
func (c *ContextualLog) Error(msg string) *ContextualLog
Error used to log something with Error level, and also print out all saved metadata
func (*ContextualLog) Errorf ¶
func (c *ContextualLog) Errorf(format string, v ...interface{}) *ContextualLog
Errorf used to log formatted string with Error level, and also print out all saved metadata
func (*ContextualLog) Fatal ¶
func (c *ContextualLog) Fatal(msg string) *ContextualLog
Fatal used to log something with Fatal level, and also print out all saved metadata
func (*ContextualLog) Fatalf ¶
func (c *ContextualLog) Fatalf(format string, v ...interface{}) *ContextualLog
Fatalf used to log something with Fatal level, and also print out all saved metadata
func (*ContextualLog) Info ¶
func (c *ContextualLog) Info(msg string) *ContextualLog
Info used to log something with Info level
func (*ContextualLog) Infof ¶
func (c *ContextualLog) Infof(format string, v ...interface{}) *ContextualLog
Infof used to log formatted string with Info level
func (*ContextualLog) Measure ¶
func (c *ContextualLog) Measure()
Measure used to setup time measurement. This method should not return current object's instance.
func (*ContextualLog) Meta ¶
func (c *ContextualLog) Meta(kv ...KeyValue) *ContextualLog
Meta used to setup metadata contains of key value objects
func (*ContextualLog) NewContextual ¶
func (c *ContextualLog) NewContextual(name string) *ContextualLog
NewContextual used to create new instance from current instance but only need to define context name
func (*ContextualLog) Warn ¶
func (c *ContextualLog) Warn(msg string) *ContextualLog
Warn used to log something with Warn level
func (*ContextualLog) Warnf ¶
func (c *ContextualLog) Warnf(format string, v ...interface{}) *ContextualLog
Warnf used to log formatted string with Warn level
type KeyValue ¶
type KeyValue struct { Key string Value interface{} }
KeyValue used to save all metadata
type Log ¶
type Log struct {
// contains filtered or unexported fields
}
Log is main object for our logging methods
type Logger ¶
type Logger interface { Debug(msg string) Debugf(format string, v ...interface{}) Warn(msg string) Warnf(format string, v ...interface{}) Info(msg string) Infof(format string, v ...interface{}) Error(msg string) Errorf(format string, v ...interface{}) Fatal(msg string) Fatalf(format string, v ...interface{}) }
Logger is main abstraction
type Option ¶
Option used to setup logging level and flag if we need to run it in another goroutine or not