logging

package
v0.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2021 License: Apache-2.0 Imports: 23 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init added in v0.14.0

func Init(jsonCfg string, cfg *config.App) error

Init initializes sirupsen/logrus hooks from the JSON config string. It also sets the sirupsen/logrus as a logger for 3rd party libraries.

Types

type LogRecord added in v0.18.0

type LogRecord struct {
	Context   map[string]interface{} `json:"context,omitempty"`
	Category  string                 `json:"category,omitempty"`
	AppName   string                 `json:"appname"`
	HostName  string                 `json:"hostname"`
	LogLevel  string                 `json:"logLevel"`
	FileName  string                 `json:"filename"`
	FuncName  string                 `json:"funcName"`
	LineNo    int                    `json:"lineno"`
	Message   string                 `json:"message"`
	Timestamp number                 `json:"timestamp"`
	CID       string                 `json:"cid,omitempty"`
	PID       int                    `json:"pid,omitempty"`
	TID       string                 `json:"tid,omitempty"`
	ExcType   string                 `json:"excType,omitempty"`
	ExcText   string                 `json:"excText,omitempty"`
	ExcValue  string                 `json:"excValue,omitempty"`
}

func (*LogRecord) FromFields added in v0.18.0

func (r *LogRecord) FromFields(fields logrus.Fields)

func (LogRecord) MarshalEasyJSON added in v0.18.0

func (v LogRecord) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (LogRecord) MarshalJSON added in v0.18.0

func (v LogRecord) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*LogRecord) UnmarshalEasyJSON added in v0.18.0

func (v *LogRecord) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*LogRecord) UnmarshalJSON added in v0.18.0

func (v *LogRecord) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL