Adding GetDebug method to loggers.
This commit is contained in:
@@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
/*
|
||||
Logger is one of the various loggers offered by this module.
|
||||
Logger is one of the various loggers offered by this module.
|
||||
*/
|
||||
type Logger interface {
|
||||
Alert(s string, v ...interface{}) (err error)
|
||||
@@ -18,6 +18,7 @@ type Logger interface {
|
||||
Notice(s string, v ...interface{}) (err error)
|
||||
Warning(s string, v ...interface{}) (err error)
|
||||
DoDebug(d bool) (err error)
|
||||
GetDebug() (d bool)
|
||||
SetPrefix(p string) (err error)
|
||||
GetPrefix() (p string, err error)
|
||||
Setup() (err error)
|
||||
@@ -25,8 +26,8 @@ type Logger interface {
|
||||
}
|
||||
|
||||
/*
|
||||
StdLogger uses the log package in stdlib to perform all logging. The default is to write to STDOUT.
|
||||
If you wish to modify the underling log.Logger object, you can access it directly via StdLogger.Logger.
|
||||
StdLogger uses the log package in stdlib to perform all logging. The default is to write to STDOUT.
|
||||
If you wish to modify the underling log.Logger object, you can access it directly via StdLogger.Logger.
|
||||
*/
|
||||
type StdLogger struct {
|
||||
// All log.Logger fields/methods are exposed.
|
||||
@@ -71,11 +72,11 @@ type StdLogger struct {
|
||||
}
|
||||
|
||||
/*
|
||||
FileLogger uses a StdLogger with a file handle writer to write to the file given at Path.
|
||||
FileLogger uses a StdLogger with a file handle writer to write to the file given at Path.
|
||||
|
||||
NOTE: If you wish to change the FileLogger.StdLogger.LogFlags, do *not* run FileLogger.StdLogger.Setup after doing so as this
|
||||
will instead create a logger detached from the file handler. Instead, be sure to call FileLogger.Setup.
|
||||
(Alternatively, run FileLogger.Shutdown and replace your logger with a new FileLogger.)
|
||||
NOTE: If you wish to change the FileLogger.StdLogger.LogFlags, do *not* run FileLogger.StdLogger.Setup after doing so as this
|
||||
will instead create a logger detached from the file handler. Instead, be sure to call FileLogger.Setup.
|
||||
(Alternatively, run FileLogger.Shutdown and replace your logger with a new FileLogger.)
|
||||
*/
|
||||
type FileLogger struct {
|
||||
// StdLogger is used for the log formation and handling. See StdLogger for more details.
|
||||
|
||||
Reference in New Issue
Block a user