Documentation ¶
Overview ¶
high level log wrapper, so it can output different log based on level
Index ¶
- Constants
- func CrashLog(file string)
- 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 LogTypeToString(t LogType) (string, string)
- func Logger() *log.Logger
- func New() *logger
- func Newlogger(w io.Writer, prefix string) *logger
- func SetFlags(flags int)
- func SetHighlighting(highlighting bool)
- func SetLevel(level LogLevel)
- func SetLevelByString(level string)
- func SetOutput(out io.Writer)
- func SetOutputByName(path string) error
- func SetRotateByDay()
- func SetRotateByHour()
- func Warning(v ...interface{})
- func Warningf(format string, v ...interface{})
- type LogLevel
- type LogType
Constants ¶
View Source
const ( Ldate = log.Ldate Llongfile = log.Llongfile Lmicroseconds = log.Lmicroseconds Lshortfile = log.Lshortfile LstdFlags = log.LstdFlags Ltime = log.Ltime )
View Source
const ( LOG_FATAL = LogType(0x1) LOG_ERROR = LogType(0x2) LOG_WARNING = LogType(0x4) LOG_INFO = LogType(0x8) LOG_DEBUG = LogType(0x10) )
View Source
const ( LOG_LEVEL_NONE = LogLevel(0x0) LOG_LEVEL_FATAL = LOG_LEVEL_NONE | LogLevel(LOG_FATAL) LOG_LEVEL_ERROR = LOG_LEVEL_FATAL | LogLevel(LOG_ERROR) LOG_LEVEL_WARN = LOG_LEVEL_ERROR | LogLevel(LOG_WARNING) LOG_LEVEL_INFO = LOG_LEVEL_WARN | LogLevel(LOG_INFO) LOG_LEVEL_DEBUG = LOG_LEVEL_INFO | LogLevel(LOG_DEBUG) LOG_LEVEL_ALL = LOG_LEVEL_DEBUG )
View Source
const FORMAT_TIME_DAY string = "20060102"
View Source
const FORMAT_TIME_HOUR string = "2006010215"
Variables ¶
This section is empty.
Functions ¶
func LogTypeToString ¶
func SetHighlighting ¶
func SetHighlighting(highlighting bool)
func SetLevelByString ¶
func SetLevelByString(level string)
func SetOutputByName ¶
func SetRotateByDay ¶
func SetRotateByDay()
func SetRotateByHour ¶
func SetRotateByHour()
Types ¶
type LogLevel ¶
type LogLevel int
func GetLogLevel ¶
func GetLogLevel() LogLevel
func StringToLogLevel ¶
Click to show internal directories.
Click to hide internal directories.