Documentation ¶
Overview ¶
Package logger Created by RTT. Author: teocci@yandex.com on 2021-Aug-27
Package logger Created by Teocci. Author: teocci@yandex.com on 2021-Aug-23
Index ¶
- func ErrCanNotInitSyslog(e error) error
- func ErrCanNotOpenLogFile(p string, e error) error
- func GetDefaultLevelName() string
- func GetLevelName(level Level) string
- func NewSyslog(prefix string) (io.WriteCloser, error)
- type Destination
- type Level
- type LogConfig
- type Logger
- func (l *Logger) Close()
- func (l *Logger) Error(v ...interface{})
- func (l *Logger) Errorf(format string, v ...interface{})
- func (l *Logger) Errorln(v ...interface{})
- func (l *Logger) Fatal(v ...interface{})
- func (l *Logger) Fatalf(format string, v ...interface{})
- func (l *Logger) Fatalln(v ...interface{})
- func (l *Logger) Info(v ...interface{})
- func (l *Logger) Infof(format string, v ...interface{})
- func (l *Logger) Infoln(v ...interface{})
- func (l *Logger) Log(level Level, format string, args ...interface{})
- func (l *Logger) Warning(v ...interface{})
- func (l *Logger) Warningf(format string, v ...interface{})
- func (l *Logger) Warningln(v ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrCanNotInitSyslog ¶
func ErrCanNotOpenLogFile ¶
func GetDefaultLevelName ¶
func GetDefaultLevelName() string
func GetLevelName ¶
Types ¶
type Destination ¶
type Destination int
Destination is a log destination.
const ( // DestinationStdout writes logs to the standard output. DestinationStdout Destination = iota // DestinationFile writes logs to a file. DestinationFile // DestinationSyslog writes logs to the system logger. DestinationSyslog )
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is a log handler.
func (*Logger) Error ¶
func (l *Logger) Error(v ...interface{})
Error logs with the ERROR severity. Arguments are handled in the manner of fmt.Print.
func (*Logger) Errorf ¶
Errorf logs with the Error severity. Arguments are handled in the manner of fmt.Printf.
func (*Logger) Errorln ¶
func (l *Logger) Errorln(v ...interface{})
Errorln logs with the ERROR severity. Arguments are handled in the manner of fmt.Println.
func (*Logger) Fatal ¶
func (l *Logger) Fatal(v ...interface{})
Fatal uses the default logger, logs with the sFatal severity, and ends with os.Exit(1). Arguments are handled in the manner of fmt.Print.
func (*Logger) Fatalf ¶
Fatalf uses the default logger, logs with the sFatal severity, and ends with os.Exit(1). Arguments are handled in the manner of fmt.Printf.
func (*Logger) Fatalln ¶
func (l *Logger) Fatalln(v ...interface{})
Fatalln uses the default logger, logs with the sFatal severity, and ends with os.Exit(1). Arguments are handled in the manner of fmt.Println.
func (*Logger) Info ¶
func (l *Logger) Info(v ...interface{})
Info logs with the Info severity. Arguments are handled in the manner of fmt.Print.
func (*Logger) Infof ¶
Infof logs with the Info severity. Arguments are handled in the manner of fmt.Printf.
func (*Logger) Infoln ¶
func (l *Logger) Infoln(v ...interface{})
Infoln logs with the Info severity. Arguments are handled in the manner of fmt.Println.
func (*Logger) Warning ¶
func (l *Logger) Warning(v ...interface{})
Warning logs with the Warning severity. Arguments are handled in the manner of fmt.Print.