Documentation ¶
Index ¶
- Constants
- func AppFileErrorLog(format string, a ...interface{}) error
- func DPanicf(format string, args ...interface{})
- func Debugf(format string, args ...interface{})
- func Errorf(format string, args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Infof(format string, args ...interface{})
- func IsTerminal(w io.Writer) bool
- func Panicf(format string, args ...interface{})
- func ServerErrorLog(format string, a ...interface{})
- func Setup(isProduction, enableSysLog bool, level, filepath, args string)
- func Shutdown()
- func Warnf(format string, args ...interface{})
- func WriteFileLog(filename, format string, a ...interface{}) error
- type FileLogger
- type Hooker
- type SyslogHook
Constants ¶
View Source
const (
TimestampFormat = "2006-01-02 15:04:05.999"
)
Variables ¶
This section is empty.
Functions ¶
func AppFileErrorLog ¶
func IsTerminal ¶
func WriteFileLog ¶
Types ¶
type FileLogger ¶
type FileLogger struct {
// contains filtered or unexported fields
}
记录日志到文件
func NewFileWriter ¶
func NewFileWriter(prefix string) *FileLogger
func (*FileLogger) Sync ¶
func (w *FileLogger) Sync() error
func (*FileLogger) Write ¶
func (w *FileLogger) Write(data []byte) error
type SyslogHook ¶
type SyslogHook struct {
// contains filtered or unexported fields
}
SyslogHook to send logs via syslog.
func (*SyslogHook) Name ¶
func (h *SyslogHook) Name() string
Click to show internal directories.
Click to hide internal directories.