Documentation ¶
Index ¶
- Constants
- Variables
- func SetDefaultFormat(format string)
- func Stack() string
- type Info
- type LogLevel
- type Logger
- func (l *Logger) Critical(message string)
- func (l *Logger) CriticalF(format string, a ...interface{})
- func (l *Logger) Criticalf(format string, a ...interface{})
- func (l *Logger) Debug(message string)
- func (l *Logger) DebugF(format string, a ...interface{})
- func (l *Logger) Debugf(format string, a ...interface{})
- func (l *Logger) Error(message string)
- func (l *Logger) ErrorF(format string, a ...interface{})
- func (l *Logger) Errorf(format string, a ...interface{})
- func (l *Logger) Fatal(message string)
- func (l *Logger) FatalF(format string, a ...interface{})
- func (l *Logger) Fatalf(format string, a ...interface{})
- func (l *Logger) Info(message string)
- func (l *Logger) InfoF(format string, a ...interface{})
- func (l *Logger) Infof(format string, a ...interface{})
- func (l *Logger) Log(lvl LogLevel, message string)
- func (l *Logger) LogWrapped(lvl LogLevel, message string) string
- func (l *Logger) Notice(message string)
- func (l *Logger) NoticeF(format string, a ...interface{})
- func (l *Logger) Noticef(format string, a ...interface{})
- func (l *Logger) Panic(message string)
- func (l *Logger) PanicF(format string, a ...interface{})
- func (l *Logger) Panicf(format string, a ...interface{})
- func (l *Logger) SetFormat(format string)
- func (l *Logger) SetLogLevel(level LogLevel)
- func (l *Logger) StackAsCritical(message string)
- func (l *Logger) StackAsError(message string)
- func (l *Logger) Warning(message string)
- func (l *Logger) WarningF(format string, a ...interface{})
- func (l *Logger) Warningf(format string, a ...interface{})
- type Worker
Constants ¶
const ( Black = (iota + 30) Red Green Yellow Blue Magenta Cyan White )
Color numbers for stdout
Variables ¶
var ( // Map for the various codes of colors Colors map[LogLevel]ctc.Color )
Functions ¶
func SetDefaultFormat ¶
func SetDefaultFormat(format string)
Types ¶
type Info ¶
type Info struct { Id uint64 Time string Module string Level LogLevel Line int Filename string Message string }
Info class, Contains all the info on what has to logged, time is the current time, Module is the specific module For which we are logging, level is the state, importance and type of message logged, Message contains the string to be logged, format is the format of string to be passed to sprintf
type Logger ¶
type Logger struct { Module string // contains filtered or unexported fields }
Logger class that is an interface to user to log messages, Module is the module for which we are testing worker is variable of Worker class that is used in bottom layers to log the message
func New ¶
func New(args ...interface{}) *Logger
Returns a new instance of logger class, module is the specific module for which we are logging , color defines whether the output is to be colored or not, out is instance of type evo.Writer defaults to os.Stderr
func (*Logger) CriticalF ¶
CriticalF logs a message at Critical level using the same syntax and options as fmt.Printf
func (*Logger) Criticalf ¶
CriticalF logs a message at Critical level using the same syntax and options as fmt.Printf
func (*Logger) DebugF ¶
DebugF logs a message at Debug level using the same syntax and options as fmt.Printf
func (*Logger) Debugf ¶
DebugF logs a message at Debug level using the same syntax and options as fmt.Printf
func (*Logger) ErrorF ¶
ErrorF logs a message at Error level using the same syntax and options as fmt.Printf
func (*Logger) Errorf ¶
ErrorF logs a message at Error level using the same syntax and options as fmt.Printf
func (*Logger) Fatal ¶
Fatal is just like func l.Critical logger except that it is followed by exit to program
func (*Logger) FatalF ¶
FatalF is just like func l.CriticalF logger except that it is followed by exit to program
func (*Logger) Fatalf ¶
FatalF is just like func l.CriticalF logger except that it is followed by exit to program
func (*Logger) InfoF ¶
InfoF logs a message at Info level using the same syntax and options as fmt.Printf
func (*Logger) Infof ¶
InfoF logs a message at Info level using the same syntax and options as fmt.Printf
func (*Logger) Log ¶
The log commnand is the function available to user to log message, lvl specifies the degree of the messagethe user wants to log, message is the info user wants to log
func (*Logger) LogWrapped ¶
The log commnand is the function available to user to log message from wrapped function, lvl specifies the degree of the messagethe user wants to log, message is the info user wants to log
func (*Logger) NoticeF ¶
NoticeF logs a message at Notice level using the same syntax and options as fmt.Printf
func (*Logger) Noticef ¶
NoticeF logs a message at Notice level using the same syntax and options as fmt.Printf
func (*Logger) Panic ¶
Panic is just like func l.Critical except that it is followed by a call to panic
func (*Logger) PanicF ¶
PanicF is just like func l.CriticalF except that it is followed by a call to panic
func (*Logger) Panicf ¶
PanicF is just like func l.CriticalF except that it is followed by a call to panic
func (*Logger) SetLogLevel ¶
func (*Logger) StackAsCritical ¶
Prints this goroutine's execution stack as critical with an optional message at the beginning
func (*Logger) StackAsError ¶
Prints this goroutine's execution stack as an error with an optional message at the beginning
type Worker ¶
Worker class, Worker is a log object used to log messages and Color specifies if colored output is to be produced
func NewWorker ¶
Returns an instance of worker class, prefix is the string attached to every log, flag determine the log params, color parameters verifies whether we need colored outputs or not