Documentation
¶
Index ¶
- Constants
- type Line
- type Logger
- type LoggerOption
- type Span
- type Tag
- func Any(key string, val interface{}) Tag
- func Bool(key string, val bool) Tag
- func Error(key string, val error) Tag
- func Float32(key string, val float32) Tag
- func Float64(key string, val float64) Tag
- func Int(key string, val int) Tag
- func Int8(key string, val int8) Tag
- func Int16(key string, val int16) Tag
- func Int32(key string, val int32) Tag
- func Int64(key string, val int64) Tag
- func Skip() Tag
- func String(key, val string) Tag
- func Uint(key string, val uint) Tag
- func Uint8(key string, val uint8) Tag
- func Uint16(key string, val uint16) Tag
- func Uint32(key string, val uint32) Tag
- func Uint64(key string, val uint64) Tag
- type TagType
- type Transaction
Constants ¶
const ( // IncrementalSpan if only add this tag when create the Span, then only count the transactions but not // calculate any duration IncrementalSpan = iota + 1 // DurationSpan if only add this tag when create the Span, then only calculate the total duration of // the all transactions but not count them. DurationSpan )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Line ¶
Line represent a Canonical Log Lines in which is accumulated all the information about the process.
func (*Line) MarkAsCritical ¶
MarkAsCritical change the severity of the line to CRITICAL.
func (*Line) MarkAsError ¶
MarkAsError change the severity of the line to ERROR.
func (*Line) MarkAsInfo ¶
MarkAsInfo change the severity of the line to INFO.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is our Logger for Canonical Log Lines implementation. You should initialize it using the New method.
func New ¶
func New(opts ...LoggerOption) *Logger
New returns a new Logger If any report has ben added the log reporter will be the default
func (*Logger) LineFromContext ¶
LineFromContext returns a canonical line using the line found in context. If not found a line in context then new line is created. The line created is mark as severity Info for reporter.
type LoggerOption ¶
type LoggerOption func(*Logger)
LoggerOption allow to adjust behaviour of the Logger to be created with New() method.
func WithReporters ¶
func WithReporters(reporters ...reporter.Reporter) LoggerOption
WithReporters allow to add multiples reporters to our logger
type Span ¶
Span represents an active, un-finished span in the Canonical Log Line system.
func (*Span) FinishTransaction ¶
func (s *Span) FinishTransaction(t Transaction)
FinishTransaction calculate the duration of the all transaction period and add to the transactions span.
func (*Span) StartTransaction ¶
func (s *Span) StartTransaction(name string) Transaction
StartTransaction initialize a new transaction, this save the timestamp when transaction start.
type Tag ¶
type Tag struct {
// contains filtered or unexported fields
}
Tag represent a key-value pair to a logger's context.
func Skip ¶
func Skip() Tag
Skip constructs a tag no-op for handle with invalid arguments when construct other tags.
func (Tag) String ¶
String transform tag to `logFmt format (https://brandur.org/logfmt)
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
Transaction represent a sequence of information exchange and related work.