Documentation
¶
Index ¶
- func Cleanup()
- func Debug(format string, msg ...interface{})
- func Error(format string, msg ...interface{})
- func Info(format string, msg ...interface{})
- func Warn(format string, msg ...interface{})
- type Glog
- type Glogger
- type JSONGlog
- type LogLevel
- type LoggerJson
- type Options
- type UnstructureGlog
- func (g *UnstructureGlog) Cleanup()
- func (g *UnstructureGlog) Debug(format string, msg ...interface{})
- func (g *UnstructureGlog) Error(format string, msg ...interface{})
- func (g *UnstructureGlog) Info(format string, msg ...interface{})
- func (g *UnstructureGlog) Warn(format string, msg ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Glog ¶
type Glog struct {
// contains filtered or unexported fields
}
Glog type is the logger data for logging concurrently to file
type Glogger ¶
type Glogger interface {
Error(string, ...interface{})
Warn(string, ...interface{})
Info(string, ...interface{})
Debug(string, ...interface{})
Cleanup()
// contains filtered or unexported methods
}
Glogger is the interface for controlling logging
func JSONGlogger ¶
JSONGlogger creates a new Glog object with the given file name and options for formatting the log messages. The file is created if it does not exist. The file is opened in append mode. The log messages are queued and written to the file in a separate goroutine. The queue is unbuffered.
func UnstructureGlogger ¶
UnstructureGlogger creates a new Glog object with the given file name and options for formatting the log messages. The file is created if it does not exist. The file is opened in append mode. The log messages are queued and written to the file in a separate goroutine. The queue is unbuffered.
type JSONGlog ¶
type JSONGlog struct {
Glog
}
JSONGlog type is the logger data for logging concurrently to file easyjson:skip
type LoggerJson ¶
type LoggerJson struct {
Time string `json:"time"`
Type string `json:"type"`
File string `json:"file"`
Line string `json:"line"`
Msg map[string]interface{} `json:"msg"`
}
easyjson:json
func (LoggerJson) MarshalEasyJSON ¶
func (v LoggerJson) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (LoggerJson) MarshalJSON ¶
func (v LoggerJson) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*LoggerJson) UnmarshalEasyJSON ¶
func (v *LoggerJson) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*LoggerJson) UnmarshalJSON ¶
func (v *LoggerJson) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type UnstructureGlog ¶
type UnstructureGlog struct {
Glog
}
UnstructureGlog type is the logger data for logging concurrently to file
func (*UnstructureGlog) Cleanup ¶
func (g *UnstructureGlog) Cleanup()
safely close the custom logger
func (*UnstructureGlog) Debug ¶
func (g *UnstructureGlog) Debug(format string, msg ...interface{})
Debug logs the warning message to the file
func (*UnstructureGlog) Error ¶
func (g *UnstructureGlog) Error(format string, msg ...interface{})
Error logs the error message to the file
func (*UnstructureGlog) Info ¶
func (g *UnstructureGlog) Info(format string, msg ...interface{})
Info logs the warning message to the file
func (*UnstructureGlog) Warn ¶
func (g *UnstructureGlog) Warn(format string, msg ...interface{})
Warn logs the warning message to the file