Documentation
¶
Index ¶
- func New(level sparalog.Level, line string) sparalog.Item
- func NewError(skipStackCalls int, err error) sparalog.Item
- func NewErrorf(skipStackCalls int, format string, a ...interface{}) sparalog.Item
- type Context
- func (c *Context) AssignContext(fromCtx sparalog.Context, clone bool)
- func (c *Context) Data() map[string]interface{}
- func (c *Context) Prefix() (format string, tags []string)
- func (c *Context) RenderPrefix() string
- func (c *Context) SetData(key string, value interface{})
- func (c *Context) SetPrefix(format string, tags []string)
- func (c *Context) SetTag(name, value string)
- func (c *Context) Tags() map[string]string
- type Item
- func (i *Item) GenerateStackTrace(callsToSkip int)
- func (i *Item) Level() sparalog.Level
- func (i *Item) Line() string
- func (i *Item) Log()
- func (i *Item) SetLine(s string)
- func (i *Item) SetLogger(logger sparalog.ItemLogger)
- func (i *Item) SetStackTrace(s string)
- func (i *Item) StackTrace() string
- func (i Item) ToString(timestamp, level bool) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context implements sparalog.Context
func (*Context) AssignContext ¶
AssignContext clone a context to current.
func (*Context) RenderPrefix ¶
RenderPrefix returns a prefix as rendered string.
func (*Context) SetPrefix ¶
SetPrefix change the prefix for the context. Tags contains the list of tags names used as params for format.
type Item ¶
type Item struct {
Context
// contains filtered or unexported fields
}
Item implements sparalog.Item
func (*Item) GenerateStackTrace ¶
GenerateStackTrace assign the stack trace of current position to the item.
func (*Item) SetLogger ¶
func (i *Item) SetLogger(logger sparalog.ItemLogger)
SetLogger assigns a logger to the item, for Log() further using.
func (*Item) SetStackTrace ¶
SetStackTrace assign a stack trace to the item.
func (*Item) StackTrace ¶
StackTrace gets the stack trace of the item.
Click to show internal directories.
Click to hide internal directories.