Documentation
¶
Index ¶
- Variables
- func AddLevelWriter(level sparalog.Level, w sparalog.Writer)
- func AddLevelsWriter(levels []sparalog.Level, w sparalog.Writer)
- func AddWriter(w sparalog.Writer)
- func Debug(args ...interface{})
- func Debugf(format string, args ...interface{})
- func Done()
- func EnableStacktrace(level sparalog.Level, state bool)
- func Error(args ...interface{})
- func Errorf(format string, args ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func Mute(level sparalog.Level, state bool)
- func NewAliasLogger() sparalog.Logger
- func NewCallbackAsyncWriter(callback writers.CallbackWriterCallback) sparalog.Writer
- func NewCallbackWriter(callback writers.CallbackWriterCallback) sparalog.Writer
- func NewError(err error) sparalog.Item
- func NewErrorf(format string, a ...interface{}) sparalog.Item
- func NewFileWriter(filename string) (sparalog.Writer, error)
- func NewItem(level sparalog.Level, args ...string) sparalog.Item
- func NewItemf(level sparalog.Level, format string, args ...string) sparalog.Item
- func NewLogger() *logger.Logger
- func NewStdoutWriter() sparalog.Writer
- func NewSyslogWriter(tag string) sparalog.Writer
- func NewTCPWriter(address string, port int, debug bool, cb writers.StateChangeCallback) (sparalog.Writer, error)
- func NewTelegramWriter(botAPIKey string, channelID int) sparalog.Writer
- func Open()
- func Print(args ...interface{})
- func Printf(format string, args ...interface{})
- func RemoveWriter(level sparalog.Level, id sparalog.WriterID)
- func ResetLevelWriters(level sparalog.Level, defaultW sparalog.Writer)
- func ResetLevelsWriters(levels []sparalog.Level, defaultW sparalog.Writer)
- func ResetWriters(defaultW sparalog.Writer)
- func SetContextData(key string, value interface{})
- func SetContextPrefix(format string, tags []string)
- func SetContextTag(name, value string)
- func StartPanicWatcher()
- func Trace(args ...interface{})
- func Tracef(format string, args ...interface{})
- func Warn(args ...interface{})
- func Warnf(format string, args ...interface{})
Constants ¶
This section is empty.
Variables ¶
var Default sparalog.Logger
Default is the default global logger.
var DefaultDispatcher sparalog.Dispatcher
DefaultDispatcher is the default global dispatcher.
var DefaultStdoutWriter sparalog.Writer
DefaultStdoutWriter is the default global writer to stdout.
Functions ¶
func AddLevelWriter ¶
AddLevelWriter add a writer to a level.
func AddLevelsWriter ¶
AddLevelsWriter add a writer to several levels.
func Debug ¶
func Debug(args ...interface{})
Debug sends to Default logger debug stream using the same fmt.Print() interface.
func Debugf ¶
func Debugf(format string, args ...interface{})
Debugf sends to Default logger debug stream using the same fmt.Printf() interface.
func Done ¶
func Done()
Done manages (current routine) panics and closes all the loggers, waiting gently for the async writers. It should be called at main exit.
func EnableStacktrace ¶
EnableStacktrace enable stacktrace for a specific level.
func Error ¶
func Error(args ...interface{})
Error sends to Default logger error stream using the same fmt.Print() interface.
func Errorf ¶
func Errorf(format string, args ...interface{})
Errorf sends to Default logger error stream using the same fmt.Printf() interface.
func Fatal ¶
func Fatal(args ...interface{})
Fatal sends to Default logger fatal stream using the same fmt.Print() interface.
func Fatalf ¶
func Fatalf(format string, args ...interface{})
Fatalf sends to Default logger fatal stream using the same fmt.Printf() interface.
func Info ¶
func Info(args ...interface{})
Info sends to Default logger info stream using the same fmt.Print() interface.
func Infof ¶
func Infof(format string, args ...interface{})
Infof sends to Default logger info stream using the same fmt.Printf() interface.
func NewAliasLogger ¶
NewAliasLogger allocate a logger that uses logs.Default writers.
func NewCallbackAsyncWriter ¶
func NewCallbackAsyncWriter(callback writers.CallbackWriterCallback) sparalog.Writer
NewCallbackAsyncWriter returns a new callbackAsyncWriter.
func NewCallbackWriter ¶
func NewCallbackWriter(callback writers.CallbackWriterCallback) sparalog.Writer
NewCallbackWriter returns a new callbackWriter.
func NewFileWriter ¶
NewFileWriter returns a new fileWriter.
func NewStdoutWriter ¶
NewStdoutWriter returns a new stdoutWriter.
func NewSyslogWriter ¶
NewSyslogWriter returns a new syslogWriter.
func NewTCPWriter ¶
func NewTCPWriter(address string, port int, debug bool, cb writers.StateChangeCallback) (sparalog.Writer, error)
NewTCPWriter return a new tcpWriter.
func NewTelegramWriter ¶
NewTelegramWriter returns a new telegramWriter.
func Open ¶
func Open()
Open start the logger an all the writers. It should be called after writers initialization.
func Print ¶
func Print(args ...interface{})
Print sends to Default logger info stream using the same fmt.Print() interface.
func Printf ¶
func Printf(format string, args ...interface{})
Printf sends to Default logger info stream using the same fmt.Printf() interface.
func RemoveWriter ¶
RemoveWriter delete a specific writer from level.
func ResetLevelWriters ¶
ResetLevelWriters remove all level's writers and reset to an optional default writer.
func ResetLevelsWriters ¶
ResetLevelsWriters remove specific levels writers and reset to an optional default writer.
func ResetWriters ¶
ResetWriters reset the writers for all the levels to an optional default writer.
func SetContextData ¶
func SetContextData(key string, value interface{})
SetContextData sets a context data payload.
func SetContextPrefix ¶
SetContextPrefix sets the context prefix. Tags is the list of the tags names that will be rendered according to format.
func StartPanicWatcher ¶
func StartPanicWatcher()
StartPanicWatcher starts a supervisor that monitors panics in all goroutines. Since the supervision is made starting a parent + child processes: - Call the function after all writers initialization, or at least after fatal level initialization; - This function should not to be called in debugging sessions.
func Trace ¶
func Trace(args ...interface{})
Trace sends to Default logger trace stream using the same fmt.Print() interface.
func Tracef ¶
func Tracef(format string, args ...interface{})
Tracef sends to Default logger trace stream using the same fmt.Printf() interface.
Types ¶
This section is empty.