Documentation
¶
Index ¶
- func Crit(v ...interface{})
- func Critf(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 JSON(v ...interface{})
- func Notice(v ...interface{})
- func Noticef(format string, v ...interface{})
- func SetLevel(level string) error
- func SetTimeFormat(format string)
- func Warn(v ...interface{})
- func Warnf(format string, v ...interface{})
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Crit ¶
func Crit(v ...interface{})
Crit logs provided arguments to console when level is CRIT, ERROR, WARN, NOTICE, INFO or DEBUG.
func Critf ¶
func Critf(format string, v ...interface{})
Critf logs provided arguments to console when level is CRIT, ERROR, WARN, NOTICE, INFO or DEBUG.
func Debug ¶
func Debug(v ...interface{})
Debug logs provided arguments to console with extra info. Works only when level sets to DEBUG (default)
func Debugf ¶
func Debugf(format string, v ...interface{})
Debugf logs provided arguments to console with extra info. Works only when level sets to DEBUG (default)
func Error ¶
func Error(v ...interface{})
Error logs provided arguments to console when level is ERROR, WARN, NOTICE, INFO or DEBUG.
func Errorf ¶
func Errorf(format string, v ...interface{})
Errorf logs provided arguments to console when level is ERROR, WARN, NOTICE, INFO or DEBUG.
func Info ¶
func Info(v ...interface{})
Info logs provided arguments to console when level is INFO or DEBUG.
Example ¶
// This is for matching with output time :) logger.SetTimeFormat("dummy-time") logger.SetLevel("INFO") logger.Info("Some string for info", 123, []interface{}{"val1", 321})
Output: [APP] dummy-time [INFO] logger-example_test.go:11 ▶ Some string for info | 123 | [val1 321]
func Infof ¶
func Infof(format string, v ...interface{})
Infof logs provided arguments to console when level is INFO or DEBUG.
func JSON ¶
func JSON(v ...interface{})
JSON logs provided arguments to console with json.MarshalIndent each arguments. Works only when level sets to DEBUG (default)
func Notice ¶
func Notice(v ...interface{})
Notice logs provided arguments to console when level is NOTICE, INFO or DEBUG.
func Noticef ¶
func Noticef(format string, v ...interface{})
Noticef logs provided arguments to console when level is NOTICE, INFO or DEBUG.
func SetLevel ¶
SetLevel sets level of logging. level can be "CRIT", 'ERROR', 'WARN', "NOTICE", "INFO" or "DEBUG"
func SetTimeFormat ¶
func SetTimeFormat(format string)
SetTimeFormat sets string format for time.Time.Format() method Default is "2006/01/02 - 15:04:05"
Types ¶
This section is empty.