thinkgo: github.com/thinkoner/thinkgo/log Index | Files | Directories

package log

import "github.com/thinkoner/thinkgo/log"

Index

Package Files

log.go logger.go

func Alert Uses

func Alert(format string, v ...interface{}) (bool, error)

Alert Adds a log record at the ALERT level.

func Crit Uses

func Crit(format string, v ...interface{}) (bool, error)

Crit Adds a log record at the CRITICAL level.

func Debug Uses

func Debug(format string, v ...interface{}) (bool, error)

Debug Adds a log record at the DEBUG level.

func Emerg Uses

func Emerg(format string, v ...interface{}) (bool, error)

Emerg Adds a log record at the EMERGENCY level.

func Error Uses

func Error(format string, v ...interface{}) (bool, error)

Error Adds a log record at the ERROR level.

func GetLevelName Uses

func GetLevelName(level record.Level) (string, error)

Gets the name of the logging level.

func Info Uses

func Info(format string, v ...interface{}) (bool, error)

Info Adds a log record at the INFO level.

func Notice Uses

func Notice(format string, v ...interface{}) (bool, error)

Notice Adds a log record at the NOTICE level.

func SetLogger Uses

func SetLogger(l *Logger)

SetLogger Set the default Logger

func Warn Uses

func Warn(format string, v ...interface{}) (bool, error)

Warn Adds a log record at the WARNING level.

type Handler Uses

type Handler interface {
    IsHandling(r record.Record) bool
    Handle(r record.Record) bool
}

type Logger Uses

type Logger struct {
    // contains filtered or unexported fields
}

func GetLogger Uses

func GetLogger() *Logger

GetLogger Get the default Logger

func NewLogger Uses

func NewLogger(name string, level record.Level) *Logger

NewLogger New a Logger instance

func (*Logger) AddRecord Uses

func (logger *Logger) AddRecord(level record.Level, format string, v ...interface{}) (bool, error)

AddRecord Adds a log record.

func (*Logger) Alert Uses

func (logger *Logger) Alert(format string, v ...interface{}) (bool, error)

Alert Adds a log record at the ALERT level.

func (*Logger) Crit Uses

func (logger *Logger) Crit(format string, v ...interface{}) (bool, error)

Crit Adds a log record at the CRITICAL level.

func (*Logger) Debug Uses

func (logger *Logger) Debug(format string, v ...interface{}) (bool, error)

Debug Adds a log record at the DEBUG level.

func (*Logger) Emerg Uses

func (logger *Logger) Emerg(format string, v ...interface{}) (bool, error)

Emerg Adds a log record at the EMERGENCY level.

func (*Logger) Error Uses

func (logger *Logger) Error(format string, v ...interface{}) (bool, error)

Error Adds a log record at the ERROR level.

func (*Logger) GetHandlers Uses

func (logger *Logger) GetHandlers() []Handler

GetHandlers Returns a Handler slice

func (*Logger) GetName Uses

func (logger *Logger) GetName(name string) string

GetName Gets the name

func (*Logger) Info Uses

func (logger *Logger) Info(format string, v ...interface{}) (bool, error)

Info Adds a log record at the INFO level.

func (*Logger) Notice Uses

func (logger *Logger) Notice(format string, v ...interface{}) (bool, error)

Notice Adds a log record at the NOTICE level.

func (*Logger) PopHandler Uses

func (logger *Logger) PopHandler()

PopHandler Pops a handler from the stack

func (*Logger) PushHandler Uses

func (logger *Logger) PushHandler(handler Handler) *Logger

PushHandler Pushes a handler on to the stack.

func (*Logger) SetHandlers Uses

func (logger *Logger) SetHandlers(handlers []Handler) *Logger

SetHandlers Set handlers, replacing all existing ones.

func (*Logger) SetName Uses

func (logger *Logger) SetName(name string) *Logger

SetName Sets the name

func (*Logger) Warn Uses

func (logger *Logger) Warn(format string, v ...interface{}) (bool, error)

Warn Adds a log record at the WARNING level.

Directories

PathSynopsis
formatter
handler
record

Package log imports 6 packages (graph) and is imported by 1 packages. Updated 2019-05-29. Refresh now. Tools for package owners.