Documentation
¶
Overview ¶
package ppt <-
Index ¶
- Constants
- Variables
- func Clear()
- func Decorator(args ...string)
- func Error(args ...interface{}) string
- func Errorf(msg string, args ...interface{}) string
- func Errorln(args ...interface{}) string
- func Fatal(args ...interface{}) string
- func Fatalf(msg string, args ...interface{}) string
- func Fatalln(args ...interface{}) string
- func GetColor(color Colors) string
- func GetCurrentLevel() int
- func Info(args ...interface{}) string
- func Infof(msg string, args ...interface{}) string
- func Infoln(args ...interface{}) string
- func Init()
- func Printer(prefix Log, msg string, args ...interface{}) string
- func ResetColor() string
- func ResetCursor()
- func SetCurrentLevel(lvl Level)
- func SetErrorColor(color Colors)
- func SetFatalColor(color Colors)
- func SetInfoColor(color Colors)
- func SetTraceColor(color Colors)
- func SetVerboseColor(color Colors)
- func SetWarnColor(color Colors)
- func ToBackground(color Colors) string
- func TogglePrint()
- func Trace(args ...interface{}) string
- func Tracef(msg string, args ...interface{}) string
- func Traceln(args ...interface{}) string
- func Verbose(args ...interface{}) string
- func Verbosef(msg string, args ...interface{}) string
- func Verboseln(args ...interface{}) string
- func Warn(args ...interface{}) string
- func Warnf(msg string, args ...interface{}) string
- func Warnln(args ...interface{}) string
- func WhereAmI() string
- type Colors
- type Level
- type Log
Constants ¶
const ( // FUNC enable function call lookup in WhereAmI() FUNC = lFlag(1 << iota) // enables function name to be include in log // LINE enable line call lookup in WhereAmI() LINE // enables line number to be include in log // FILE enable line call lookup in WhereAmI() FILE // enables file name to be include in log )
const ( // Black regular black Black = Colors("30") // Red regular red Red = Colors("31") // Green regular green Green = Colors("32") // Yellow regular yellow Yellow = Colors("33") // Blue regular blue Blue = Colors("34") // Magenta regular magenta Magenta = Colors("35") // Cyan regular cyan Cyan = Colors("36") // White regular white White = Colors("37") // Gray a brighter black Gray = Colors("90") // BRed a brighter red BRed = Colors("91") // BGreen a brighter green BGreen = Colors("92") // BYellow a brighter yellow BYellow = Colors("93") // BBlue a brighter blue BBlue = Colors("94") // BMagenta a brighter magenta BMagenta = Colors("95") // BCyan a brighter cyan BCyan = Colors("96") // BWhite a brighter white BWhite = Colors("97") )
Variables ¶
var ( // FAT default fatal's log color foreground to red and background to yellowish FAT = "\033[1;31;103m" // ERR default error's log foreground color to regular red ERR = "\033[1;31m" // WRN default warn's log foreground color to regular yellow WRN = "\033[1;33m" // IFO default info's log foreground color to regular blue IFO = "\033[1;36m" // VER default verbose's log foreground color to regular green VER = "\033[1;32m" // TRA default trace's log foreground color to regular white TRA = "\033[1;37m" )
var ( LoggerFlags lFlag = 0 DisplayWarning = true // displaying pointer warning is on by default Order = false // changes the order of LoggerFlags prefix LoggerPrefix = defaultPrefix() // goes after the log type and file|func|line info LogCallback = [6]func(string, ...interface{}){} )
List of log prefixs
Functions ¶
func Decorator ¶
func Decorator(args ...string)
Decorator $log_type = [info|warn|error] $log_info = [file|func|line] $extra_prefix is developer define prefix
[0] = after log type i.e. $log_type '[' $log_info $extra_prefix $msg [1] = seperator in $log_info i.e. file '|' func '|' line [2] = after log info i.e. $log_type $log_info ']' $extra_prefix $msg
func Error ¶
func Error(args ...interface{}) string
Error formats using the default formats for its operands and writes to standard output. Spaces are added between operands when neither is a string. It returns the string displayed to console.
func Errorf ¶
Errorf formats according to a format specifier amoung other prefex and writes to standard output. It returns the string displayed to console.
func Errorln ¶
func Errorln(args ...interface{}) string
Errorln formats using the default formats for its operands and writes to standard output. Spaces are always added between operands and a newline is appended. It returns the string displayed to console.
func Fatal ¶
func Fatal(args ...interface{}) string
Fatal formats using the default formats for its operands and writes to standard output. Spaces are added between operands when neither is a string. It returns the string displayed to console.
func Fatalf ¶
Fatalf formats according to a format specifier amoung other prefex and writes to standard output. It returns the string displayed to console.
func Fatalln ¶
func Fatalln(args ...interface{}) string
Fatalln formats using the default formats for its operands and writes to standard output. Spaces are always added between operands and a newline is appended. It returns the string displayed to console.
func GetCurrentLevel ¶
func GetCurrentLevel() int
func Info ¶
func Info(args ...interface{}) string
Info formats using the default formats for its operands and writes to standard output. Spaces are added between operands when neither is a string. It returns the string displayed to console.
func Infof ¶
Infof formats according to a format specifier amoung other prefex and writes to standard output. It returns the string displayed to console.
func Infoln ¶
func Infoln(args ...interface{}) string
Infoln formats using the default formats for its operands and writes to standard output. Spaces are always added between operands and a newline is appended. It returns the string displayed to console.
func SetCurrentLevel ¶
func SetCurrentLevel(lvl Level)
func SetVerboseColor ¶
func SetVerboseColor(color Colors)
SetVerboseColor change the color of verbose log
func ToBackground ¶
ToBackground convert colors to background colors
func Trace ¶
func Trace(args ...interface{}) string
Trace formats using the default formats for its operands and writes to standard output. Spaces are added between operands when neither is a string. It returns the string displayed to console.
func Tracef ¶
Tracef formats according to a format specifier amoung other prefex and writes to standard output. It returns the string displayed to console.
func Traceln ¶
func Traceln(args ...interface{}) string
Traceln formats using the default formats for its operands and writes to standard output. Spaces are always added between operands and a newline is appended. It returns the string displayed to console.
func Verbose ¶
func Verbose(args ...interface{}) string
Verbose formats using the default formats for its operands and writes to standard output. Spaces are added between operands when neither is a string. It returns the string displayed to console.
func Verbosef ¶
Verbosef formats according to a format specifier amoung other prefex and writes to standard output. It returns the string displayed to console.
func Verboseln ¶
func Verboseln(args ...interface{}) string
Verboseln formats using the default formats for its operands and writes to standard output. Spaces are always added between operands and a newline is appended. It returns the string displayed to console.
func Warn ¶
func Warn(args ...interface{}) string
Warn formats using the default formats for its operands and writes to standard output. Spaces are added between operands when neither is a string. It returns the string displayed to console.
func Warnf ¶
Warnf formats according to a format specifier amoung other prefex and writes to standard output. It returns the string displayed to console.
Types ¶
type Level ¶
type Level uint16
const ( FatalLevel Level = lvlFATA ErrorLevel Level = lvlFATA | lvlERRO WarnLevel Level = lvlFATA | lvlERRO | lvlWARN InfoLevel Level = lvlFATA | lvlERRO | lvlWARN | lvlINFO VerboseLevel Level = lvlFATA | lvlERRO | lvlWARN | lvlINFO | lvlVBSE TraceLevel Level = lvlFATA | lvlERRO | lvlWARN | lvlINFO | lvlVBSE | lvlTRCE )