Documentation ¶
Index ¶
- Constants
- Variables
- func ApplyConfig(logConfig ILogConfig) error
- func InitLogger(logMode, logPath string) (err error)
- func Now() string
- func SetLogger(logger ILogger)
- type FileLogger
- func (l *FileLogger) Close() error
- func (l *FileLogger) Debug(params ...interface{})
- func (l *FileLogger) Debugf(format string, params ...interface{})
- func (l *FileLogger) Error(params ...interface{})
- func (l *FileLogger) Errorf(format string, params ...interface{})
- func (l *FileLogger) Info(params ...interface{})
- func (l *FileLogger) Infof(format string, params ...interface{})
- func (l *FileLogger) SetLevel(level int)
- func (l *FileLogger) Trace(params ...interface{})
- func (l *FileLogger) Tracef(format string, params ...interface{})
- type ILogConfig
- type ILogger
- type LogFile
- type SkipLogger
- func (s *SkipLogger) Close() error
- func (s *SkipLogger) Debug(params ...interface{})
- func (s *SkipLogger) Debugf(fromat string, params ...interface{})
- func (s *SkipLogger) Error(params ...interface{})
- func (s *SkipLogger) Errorf(fromat string, params ...interface{})
- func (s *SkipLogger) Info(params ...interface{})
- func (s *SkipLogger) Infof(fromat string, params ...interface{})
- func (s *SkipLogger) SetLevel(level int)
- func (s *SkipLogger) Trace(params ...interface{})
- func (s *SkipLogger) Tracef(fromat string, params ...interface{})
- type StdLogger
- func (s *StdLogger) Close() error
- func (s *StdLogger) Debug(params ...interface{})
- func (s *StdLogger) Debugf(fromat string, params ...interface{})
- func (s *StdLogger) Error(params ...interface{})
- func (s *StdLogger) Errorf(fromat string, params ...interface{})
- func (s *StdLogger) Info(params ...interface{})
- func (s *StdLogger) Infof(fromat string, params ...interface{})
- func (s *StdLogger) SetLevel(level int)
- func (s *StdLogger) Trace(params ...interface{})
- func (s *StdLogger) Tracef(fromat string, params ...interface{})
Constants ¶
View Source
const ( LogModeOff = "off" LogModeConsole = "console" LogModeFile = "file" )
View Source
const ( LogTrace = 0 LogDebug = 1 LogInfo = 2 LogError = 3 LogOff = 4 )
Variables ¶
Functions ¶
func ApplyConfig ¶
func ApplyConfig(logConfig ILogConfig) error
func InitLogger ¶
Types ¶
type FileLogger ¶
type FileLogger struct { Out io.WriteCloser Level int }
func (*FileLogger) Close ¶
func (l *FileLogger) Close() error
func (*FileLogger) Debug ¶
func (l *FileLogger) Debug(params ...interface{})
func (*FileLogger) Debugf ¶
func (l *FileLogger) Debugf(format string, params ...interface{})
func (*FileLogger) Error ¶
func (l *FileLogger) Error(params ...interface{})
func (*FileLogger) Errorf ¶
func (l *FileLogger) Errorf(format string, params ...interface{})
func (*FileLogger) Info ¶
func (l *FileLogger) Info(params ...interface{})
func (*FileLogger) Infof ¶
func (l *FileLogger) Infof(format string, params ...interface{})
func (*FileLogger) SetLevel ¶
func (l *FileLogger) SetLevel(level int)
func (*FileLogger) Trace ¶
func (l *FileLogger) Trace(params ...interface{})
func (*FileLogger) Tracef ¶
func (l *FileLogger) Tracef(format string, params ...interface{})
type ILogConfig ¶
type ILogConfig interface {
GetLogLevel() string
}
type ILogger ¶
type ILogger interface { SetLevel(int) Trace(...interface{}) Debug(...interface{}) Info(...interface{}) Error(...interface{}) Tracef(string, ...interface{}) Debugf(string, ...interface{}) Infof(string, ...interface{}) Errorf(string, ...interface{}) Close() error }
func NewSkipLogger ¶
func NewStdLogger ¶
type SkipLogger ¶
type SkipLogger struct{}
func (*SkipLogger) Close ¶
func (s *SkipLogger) Close() error
func (*SkipLogger) Debug ¶
func (s *SkipLogger) Debug(params ...interface{})
func (*SkipLogger) Debugf ¶
func (s *SkipLogger) Debugf(fromat string, params ...interface{})
func (*SkipLogger) Error ¶
func (s *SkipLogger) Error(params ...interface{})
func (*SkipLogger) Errorf ¶
func (s *SkipLogger) Errorf(fromat string, params ...interface{})
func (*SkipLogger) Info ¶
func (s *SkipLogger) Info(params ...interface{})
func (*SkipLogger) Infof ¶
func (s *SkipLogger) Infof(fromat string, params ...interface{})
func (*SkipLogger) SetLevel ¶
func (s *SkipLogger) SetLevel(level int)
func (*SkipLogger) Trace ¶
func (s *SkipLogger) Trace(params ...interface{})
func (*SkipLogger) Tracef ¶
func (s *SkipLogger) Tracef(fromat string, params ...interface{})
Click to show internal directories.
Click to hide internal directories.