Documentation ¶
Overview ¶
Package log aims at providing level based logging while still supporting all the code written in go's native log package.
In short ¶
log.Log method lets you log the data with levels. log.SetMinLevel lets you set minimum level to log. There are 7 levels. There are also helper methods for you to run those logs.
log.VERB log.DEBU log.INFO log.NOTI log.WARN log.ERRO log.CRIT
Compatibility ¶
The package is also compatible with go's built in log pkg. it respects any prefix you set, it will output to any output writer you set. Also, any code written using the package works with this package seamlessly. it contains all the helper funcs present in go's log pkg. By default it logs into INFO level
BUG(kittuov@gmail.com): adding file name flag just prints out log file number line rather than the calling file line number.
~~BUG(kittuov@gmail.com): No color for flags in log eg: time, short_file, date etc.~~
Use this package's methods to write logs any where
Index ¶
- Constants
- func Critical(v ...interface{})
- func Criticalf(format string, v ...interface{})
- func Debug(v ...interface{})
- func Debugf(format string, v ...interface{})
- func Error(v ...interface{})
- func Errorf(format string, v ...interface{})
- func Info(v ...interface{})
- func Infof(format string, v ...interface{})
- func Log(level int, v ...interface{})
- func Notice(v ...interface{})
- func Noticef(format string, v ...interface{})
- func SetMin(level int) error
- func Verbose(v ...interface{})
- func Verbosef(format string, v ...interface{})
- func Warn(v ...interface{})
- func Warnf(format string, v ...interface{})
- type LevelDoesNotExist
Constants ¶
const ( VERB = 0 DEBU = 1 INFO = 2 NOTI = 3 WARN = 4 ERRO = 5 CRIT = 6 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LevelDoesNotExist ¶
type LevelDoesNotExist int
func (LevelDoesNotExist) Error ¶
func (l LevelDoesNotExist) Error() string