Documentation ¶
Overview ¶
The golog package implements logging to multiple backends. Each backend can filter messages by severity mask and have custom formatter. The package includes io.Writer, console and syslog backends.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChainedFormatter ¶
type ChainedFormatter struct {
// contains filtered or unexported fields
}
func (ChainedFormatter) FormatDebug ¶
func (formatter ChainedFormatter) FormatDebug(msg string) string
func (ChainedFormatter) FormatError ¶
func (formatter ChainedFormatter) FormatError(msg string) string
func (ChainedFormatter) FormatInfo ¶
func (formatter ChainedFormatter) FormatInfo(msg string) string
func (ChainedFormatter) FormatWarning ¶
func (formatter ChainedFormatter) FormatWarning(msg string) string
type ColorFormatter ¶
type ColorFormatter struct{}
func (ColorFormatter) FormatDebug ¶
func (formatter ColorFormatter) FormatDebug(msg string) string
func (ColorFormatter) FormatError ¶
func (formatter ColorFormatter) FormatError(msg string) string
func (ColorFormatter) FormatInfo ¶
func (formatter ColorFormatter) FormatInfo(msg string) string
func (ColorFormatter) FormatWarning ¶
func (formatter ColorFormatter) FormatWarning(msg string) string
type Facility ¶
type Facility int
const ( // From /usr/include/sys/syslog.h. // These are the same up to LOG_FTP on Linux, BSD, and OS X. SYSLOG_KERN Facility = iota << 3 SYSLOG_USER SYSLOG_MAIL SYSLOG_DAEMON SYSLOG_AUTH SYSLOG_SYSLOG SYSLOG_LPR SYSLOG_NEWS SYSLOG_UUCP SYSLOG_CRON SYSLOG_AUTHPRIV SYSLOG_FTP SYSLOG_LOCAL0 SYSLOG_LOCAL1 SYSLOG_LOCAL2 SYSLOG_LOCAL3 SYSLOG_LOCAL4 SYSLOG_LOCAL5 SYSLOG_LOCAL6 SYSLOG_LOCAL7 )
type Formatter ¶
type Formatter interface { FormatError(msg string) string FormatWarning(msg string) string FormatInfo(msg string) string FormatDebug(msg string) string }
func DefaultConsoleFormatter ¶
func DefaultConsoleFormatter() Formatter
func NewChainedFormatter ¶
type Logger ¶
type Logger interface { AddBackend(mask Severity, formatter Formatter, backend Backend) Errorf(format string, args ...interface{}) Warningf(format string, args ...interface{}) Infof(format string, args ...interface{}) Debugf(format string, args ...interface{}) Fatalf(format string, args ...interface{}) }
type NewlineFormatter ¶
type NewlineFormatter struct{}
func (NewlineFormatter) FormatDebug ¶
func (formatter NewlineFormatter) FormatDebug(msg string) string
func (NewlineFormatter) FormatError ¶
func (formatter NewlineFormatter) FormatError(msg string) string
func (NewlineFormatter) FormatInfo ¶
func (formatter NewlineFormatter) FormatInfo(msg string) string
func (NewlineFormatter) FormatWarning ¶
func (formatter NewlineFormatter) FormatWarning(msg string) string
type NoopFormatter ¶
type NoopFormatter struct{}
func (NoopFormatter) FormatDebug ¶
func (_ NoopFormatter) FormatDebug(msg string) string
func (NoopFormatter) FormatError ¶
func (_ NoopFormatter) FormatError(msg string) string
func (NoopFormatter) FormatInfo ¶
func (_ NoopFormatter) FormatInfo(msg string) string
func (NoopFormatter) FormatWarning ¶
func (_ NoopFormatter) FormatWarning(msg string) string
Click to show internal directories.
Click to hide internal directories.