Documentation ¶
Index ¶
- Constants
- Variables
- func Debugf(format string, a ...interface{})
- func Errorf(format string, a ...interface{})
- func Infof(format string, a ...interface{})
- func SetFormat(format string)
- func SetLevel(level string)
- func Warnf(format string, a ...interface{})
- type CustomLogger
- type LogField
- type LogFormat
- type LogLevel
- type LogRow
- type Printer
- func New(level LogLevel) *Printer
- func NewCustom(format LogFormat, level LogLevel, clc CustomLogger) (*Printer, error)
- func NewCustomAndStd(format LogFormat, level LogLevel, clc CustomLogger) (*Printer, error)
- func NewFile(format LogFormat, level LogLevel, dir string) (*Printer, error)
- func NewStd(format LogFormat, level LogLevel) (*Printer, error)
- func (p *Printer) Close()
- func (p *Printer) Debugf(format string, a ...interface{})
- func (p *Printer) Errorf(format string, a ...interface{})
- func (p *Printer) FileFormat() LogFormat
- func (p *Printer) Infof(format string, a ...interface{})
- func (p *Printer) Level() LogLevel
- func (p *Printer) Warnf(format string, a ...interface{})
Constants ¶
View Source
const ( LogTextColorNone = "\033[0m" LogTextColorBlack = "\033[0;30m" LogTextColorRed = "\033[0;31m" LogTextColorGreen = "\033[0;32m" LogTextColorYellow = "\033[0;33m" LogTextColorBlue = "\033[0;34m" LogTextColorPurple = "\033[0;35m" LogTextColorCyan = "\033[0;36m" LogTextColorWhite = "\033[0;37m" LogTextColorNoneBold = "\033[1m" LogTextColorBlackBold = "\033[1;30m" LogTextColorRedBold = "\033[1;31m" LogTextColorGreenBold = "\033[1;32m" LogTextColorYellowBold = "\033[1;33m" LogTextColorBlueBold = "\033[1;34m" LogTextColorPurpleBold = "\033[1;35m" LogTextColorCyanBold = "\033[1;36m" LogTextColorWhiteBold = "\033[1;37m" )
View Source
const LogPrinterDefFileDir = "../var/log"
View Source
const LogTimeLayout = "2006-01-02T15:04:05.000"
Variables ¶
View Source
var LogArchivesMax int = 9
View Source
var LogExecId int64 = time.Now().UTC().UnixNano()
View Source
var LogSizeMax int64 = 16777216 // 16MB
Functions ¶
Types ¶
type CustomLogger ¶
type LogRow ¶
type LogRow struct { Level string `json:"level" cbor:"level"` Mem string `json:"mem" cbor:"mem"` Msg string `json:"msg" cbor:"msg"` Td string `json:"td" cbor:"td"` Trace string `json:"trace" cbor:"trace"` Eid string `json:"eid" cbor:"eid"` Bin string `json:"bin" cbor:"bin"` Ts string `json:"ts" cbor:"ts"` }
type Printer ¶
var Print *Printer = New(LogLevelDebug)
Printer for general purpose tasks {Debug, Info, Warn, Error, ...}
func NewCustom ¶
func NewCustom(format LogFormat, level LogLevel, clc CustomLogger) (*Printer, error)
func NewCustomAndStd ¶
func NewCustomAndStd(format LogFormat, level LogLevel, clc CustomLogger) (*Printer, error)
func (*Printer) FileFormat ¶
Click to show internal directories.
Click to hide internal directories.