Documentation ¶
Index ¶
Constants ¶
View Source
const StackTraceBufferSize = 1024 * 100
StackTraceBufferSize is a constant which defines stack track buffer size
Variables ¶
This section is empty.
Functions ¶
func FormatLogLevel ¶
FormatLogLevel is a function which returns string format of log level
Types ¶
type LogFormat ¶
type LogFormat struct { LogLevel LogLevel `json:"level"` Timestamp string `json:"timestamp"` File string `json:"file"` Message string `json:"msg"` Data Data `json:"data,omitempty"` }
LogFormat is a struct which stores details about log
type LogLevel ¶
type LogLevel int
LogLevel is a user defined variable of type int
func (LogLevel) MarshalJSON ¶
MarshalJSON is a function which returns data in JSON format
type Logger ¶
type Logger interface { RegisterSink(Sink) Session(task string, data ...Data) Logger SessionName() string Debug(action string, data ...Data) Info(action string, data ...Data) Warn(action string, data ...Data) Error(action string, err error, data ...Data) Fatal(action string, err error, data ...Data) Debugf(format string, args ...interface{}) Infof(format string, args ...interface{}) Warnf(format string, args ...interface{}) Errorf(err error, format string, args ...interface{}) Fatalf(err error, format string, args ...interface{}) WithData(Data) Logger }
Logger is a interface
func NewLoggerExt ¶
NewLoggerExt is a function which returns logger struct object
type ReconfigurableSink ¶
type ReconfigurableSink struct {
// contains filtered or unexported fields
}
ReconfigurableSink is a struct
func NewReconfigurableSink ¶
func NewReconfigurableSink(sink Sink, initialMinLogLevel LogLevel) *ReconfigurableSink
NewReconfigurableSink is a function which returns struct object
func (*ReconfigurableSink) GetMinLevel ¶
func (sink *ReconfigurableSink) GetMinLevel() LogLevel
GetMinLevel is a method which gets minimum log level
func (*ReconfigurableSink) Log ¶
func (sink *ReconfigurableSink) Log(level LogLevel, log []byte)
Log is a method which returns log level and log
func (*ReconfigurableSink) SetMinLevel ¶
func (sink *ReconfigurableSink) SetMinLevel(level LogLevel)
SetMinLevel is a function which sets minimum log level
Click to show internal directories.
Click to hide internal directories.