Documentation ¶
Index ¶
- func GetSysLoggerTag() string
- type FileLogger
- type LogOption
- type LogUTC
- type Logger
- func (l *Logger) Close() error
- func (l *Logger) Debugf(format string, v ...any)
- func (l *Logger) Errorf(format string, v ...any)
- func (l *Logger) Fatalf(format string, v ...any)
- func (l *Logger) Noticef(format string, v ...any)
- func (l *Logger) SetMaxNumFiles(max int) error
- func (l *Logger) SetSizeLimit(limit int64) error
- func (l *Logger) Tracef(format string, v ...any)
- func (l *Logger) Warnf(format string, v ...any)
- type SysLogger
- func (l *SysLogger) Close() error
- func (l *SysLogger) Debugf(format string, v ...interface{})
- func (l *SysLogger) Errorf(format string, v ...interface{})
- func (l *SysLogger) Noticef(format string, v ...interface{})
- func (l *SysLogger) Tracef(format string, v ...interface{})
- func (l *SysLogger) Warnf(format string, v ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSysLoggerTag ¶
func GetSysLoggerTag() string
GetSysLoggerTag generates a tag name for syslog based on the executable name.
Types ¶
type FileLogger ¶
type LogUTC ¶
type LogUTC bool
LogUTC controls whether timestamps in the log output should be UTC or local time.
type Logger ¶
Logger represents the server logger
func NewFileLogger ¶
NewFileLogger creates a file logger with output directed to the specified file.
func NewStdLogger ¶
NewStdLogger creates a standard logger that outputs to Stderr.
func (*Logger) Close ¶
Close implements the io.Closer interface to clean up resources in the server's logger implementation. Caller must ensure threadsafety.
func (*Logger) SetMaxNumFiles ¶
SetMaxNumFiles sets the number of archived log files that will be retained
func (*Logger) SetSizeLimit ¶
SetSizeLimit sets the size of a logfile after which a backup is created with the file name + "year.month.day.hour.min.sec.nanosec" and the current log is truncated.
type SysLogger ¶
type SysLogger struct {
// contains filtered or unexported fields
}
SysLogger provides a system logger implementation.
func NewSysLogger ¶
NewSysLogger creates a new system logger for local or remote use.