Documentation ¶
Index ¶
- Constants
- func Debug(v ...interface{})
- func Debugf(format string, v ...interface{})
- func Error(v ...interface{})
- func Errorf(format string, v ...interface{})
- func Fatal(v ...interface{})
- func Fatalf(format string, v ...interface{})
- func Info(v ...interface{})
- func Infof(format string, v ...interface{})
- func InitializeLog(level LogStatus, logFmt LogFmt, prefix, fileName, delimiter string)
- func Stack()
- func Warn(v ...interface{})
- func Warnf(format string, v ...interface{})
- type LogFmt
- type LogStatus
- type LogType
- type Logger
- func (lo *Logger) Debug(v ...interface{})
- func (lo *Logger) Debugf(format string, v ...interface{})
- func (lo *Logger) Error(v ...interface{})
- func (lo *Logger) Errorf(format string, v ...interface{})
- func (lo *Logger) Fatal(v ...interface{})
- func (lo *Logger) Fatalf(format string, v ...interface{})
- func (lo *Logger) Info(v ...interface{})
- func (lo *Logger) Infof(format string, v ...interface{})
- func (lo *Logger) Out(key string, v ...interface{})
- func (lo *Logger) Outf(key, format string, v ...interface{})
- func (lo *Logger) Stack()
- func (lo *Logger) Warn(v ...interface{})
- func (lo *Logger) Warnf(format string, v ...interface{})
Constants ¶
View Source
const ( // DebugPrefix is of debug prefix DebugPrefix string = "[DEBUG]" // InfoPrefix is of info prefix InfoPrefix string = "[INFO]" // WarningPrefix is of warning prefix WarningPrefix string = "[WARNING]" // ErrorPrefix is of error prefix ErrorPrefix string = "[ERROR]" // FatalPrefix is of fatal prefix FatalPrefix string = "[FATAL]" // StackPrefix is of fatal prefix StackPrefix string = "[STACK]" )
Variables ¶
This section is empty.
Functions ¶
func Debugf ¶
func Debugf(format string, v ...interface{})
Debugf is to call output func for debug log with format
func Errorf ¶
func Errorf(format string, v ...interface{})
Errorf is to call output func for error log with format
func Fatalf ¶
func Fatalf(format string, v ...interface{})
Fatalf is to call output func for fatal log with format
func Infof ¶
func Infof(format string, v ...interface{})
Infof is to call output func for info log with format
func InitializeLog ¶
InitializeLog is to initialize base log object using default setting
Types ¶
type LogFmt ¶
type LogFmt int
LogFmt is log format
const ( // NoDateNoFile is no date no file NoDateNoFile LogFmt = 0 // OnlyTime is only time OnlyTime LogFmt = log.Ltime // TimeShortFile is time with short file name TimeShortFile LogFmt = log.Ltime | log.Lshortfile //should be default // DateTimeShortFile is date time with short file name DateTimeShortFile LogFmt = log.LstdFlags | log.Lshortfile )
type LogStatus ¶
type LogStatus uint8
LogStatus is logStatus
const ( // DebugStatus is at debug level DebugStatus LogStatus = iota + 1 // InfoStatus is at info level InfoStatus // WarningStatus is at warning level WarningStatus // ErrorStatus is at error level ErrorStatus // FatalStatus is at fatal level FatalStatus // StackStatus is at stack level StackStatus // LogOff is at no log LogOff )
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is for log object
func (*Logger) Debug ¶
func (lo *Logger) Debug(v ...interface{})
Debug is to call output func for debug log
func (*Logger) Error ¶
func (lo *Logger) Error(v ...interface{})
Error is to call output func for error log
func (*Logger) Fatal ¶
func (lo *Logger) Fatal(v ...interface{})
Fatal is to call output func for fatal log
func (*Logger) Info ¶
func (lo *Logger) Info(v ...interface{})
Info is to call output func for info log
Click to show internal directories.
Click to hide internal directories.