Documentation ¶
Overview ¶
Package logger provides a simple logging package.
Index ¶
- Constants
- Variables
- func Debug(format string, a ...interface{})
- func Error(format string, a ...interface{})
- func Fatal(format string, a ...interface{})
- func Info(format string, a ...interface{})
- func InitAndCloseOther()
- func Success(format string, a ...interface{})
- func Warning(format string, a ...interface{})
- type CompatLogger
- func (l *CompatLogger) Debugf(format string, a ...interface{})
- func (l *CompatLogger) Errorf(format string, a ...interface{})
- func (l *CompatLogger) Fatalf(format string, a ...interface{})
- func (l *CompatLogger) Infof(format string, a ...interface{})
- func (l *CompatLogger) Successf(format string, a ...interface{})
- func (l *CompatLogger) Warningf(format string, a ...interface{})
Constants ¶
const ( LEVEL_NOSET = iota LEVEL_DEBUG LEVEL_INFO LEVEL_WARNING LEVEL_ERROR LEVEL_FATAL LEVEL_SUCCESS )
const ( FatalEmoji = "☠️" DebugEmoji = "🐞" InfoEmoji = "🦋" SuccessEmoji = "🎉" ErrorEmoji = "💔" WarningEmoji = "⚠️" )
This is the set of emoji definition.
Variables ¶
var ( // Level defines the level of the logger. It's a global option and affects Level = LEVEL_NOSET FilelineFlag = false //TimeStamps defines if the output has timestamps or not. It's a global option and affects all methods. TimeStamps = true // Color defines if the output has color or not. It's a global option and affects all methods. Color = true // BackgroundColor defines if the output has background color or not. It's a global option and affects all methods. BackgroundColor = false )
It contains configuration of logger.
Functions ¶
func Debug ¶
func Debug(format string, a ...interface{})
Debug formats according to a format specifier and writes to standard output.
func Error ¶
func Error(format string, a ...interface{})
Error formats according to a format specifier and writes to standard output.
func Fatal ¶
func Fatal(format string, a ...interface{})
Fatal formats according to a format specifier and writes to standard output.
func Info ¶
func Info(format string, a ...interface{})
Info formats according to a format specifier and writes to standard output.
Types ¶
type CompatLogger ¶
func (*CompatLogger) Debugf ¶
func (l *CompatLogger) Debugf(format string, a ...interface{})
Debug formats according to a format specifier and writes to standard output.
func (*CompatLogger) Errorf ¶
func (l *CompatLogger) Errorf(format string, a ...interface{})
Error formats according to a format specifier and writes to standard output.
func (*CompatLogger) Fatalf ¶
func (l *CompatLogger) Fatalf(format string, a ...interface{})
Fatal formats according to a format specifier and writes to standard output.
func (*CompatLogger) Infof ¶
func (l *CompatLogger) Infof(format string, a ...interface{})
func (*CompatLogger) Successf ¶
func (l *CompatLogger) Successf(format string, a ...interface{})
Success formats according to a format specifier and writes to standard output.
func (*CompatLogger) Warningf ¶
func (l *CompatLogger) Warningf(format string, a ...interface{})
Warning formats according to a format specifier and writes to standard output.