Documentation ¶
Index ¶
- Constants
- Variables
- func DebugDF(depth int, format string, argv ...interface{})
- func DebugF(format string, argv ...interface{})
- func DebugRDF(r *http.Request, depth int, format string, argv ...interface{})
- func DebugRF(r *http.Request, format string, argv ...interface{})
- func DebugWriter() *io.PipeWriter
- func Error(err error)
- func ErrorDF(depth int, format string, argv ...interface{})
- func ErrorF(format string, argv ...interface{})
- func ErrorR(r *http.Request, err error)
- func ErrorRDF(r *http.Request, depth int, format string, argv ...interface{})
- func ErrorRF(r *http.Request, format string, argv ...interface{})
- func ErrorWriter() *io.PipeWriter
- func FatalDF(depth int, format string, argv ...interface{})
- func FatalF(format string, argv ...interface{})
- func FatalRDF(r *http.Request, depth int, format string, argv ...interface{})
- func FatalRF(r *http.Request, format string, argv ...interface{})
- func InfoDF(depth int, format string, argv ...interface{})
- func InfoF(format string, argv ...interface{})
- func InfoRDF(r *http.Request, depth int, format string, argv ...interface{})
- func InfoRF(r *http.Request, format string, argv ...interface{})
- func InfoWriter() *io.PipeWriter
- func Logger() *log.Logger
- func Logrus() *logrus.Logger
- func NewPapertrailHook(appName, host string, port int) (*papertrail.Hook, error)
- func PanicDF(depth int, format string, argv ...interface{})
- func PanicF(format string, argv ...interface{})
- func PanicRDF(r *http.Request, depth int, format string, argv ...interface{})
- func PanicRF(r *http.Request, format string, argv ...interface{})
- func PrefixedLogger(prefix string) (logging *log.Logger)
- func TraceDF(depth int, format string, argv ...interface{})
- func TraceF(format string, argv ...interface{})
- func TraceRDF(r *http.Request, depth int, format string, argv ...interface{})
- func TraceRF(r *http.Request, format string, argv ...interface{})
- func TraceWriter() *io.PipeWriter
- func WarnDF(depth int, format string, argv ...interface{})
- func WarnF(format string, argv ...interface{})
- func WarnRDF(r *http.Request, depth int, format string, argv ...interface{})
- func WarnRF(r *http.Request, format string, argv ...interface{})
- func WarnWriter() *io.PipeWriter
- type Configuration
- type Format
- type Level
- type LogfLogger
- type SyslogHook
Constants ¶
View Source
const ( StandardTimestampFormat = "2006-01-02T15:04:05.000" DefaultTimestampFormat = "20060102-150405.00" )
Variables ¶
View Source
var ( Config = &Configuration{ DisableTimestamp: false, TimestampFormat: DefaultTimestampFormat, LoggingFormat: FormatPretty, LogLevel: LevelInfo, LogHook: "stdout", AppName: "", PapertrailHost: "", PapertrailPort: 0, PapertrailTag: "", } )
View Source
var Levels = map[string]Level{ "error": LevelError, "warn": LevelWarn, "info": LevelInfo, "debug": LevelDebug, "trace": LevelTrace, }
Functions ¶
func DebugWriter ¶
func DebugWriter() *io.PipeWriter
func ErrorWriter ¶
func ErrorWriter() *io.PipeWriter
func InfoWriter ¶
func InfoWriter() *io.PipeWriter
func NewPapertrailHook ¶
func NewPapertrailHook(appName, host string, port int) (*papertrail.Hook, error)
func PrefixedLogger ¶ added in v0.2.0
func TraceWriter ¶
func TraceWriter() *io.PipeWriter
func WarnWriter ¶
func WarnWriter() *io.PipeWriter
Types ¶
type Configuration ¶
type Configuration struct { DisableTimestamp bool TimestampFormat string LoggingFormat Format LogLevel Level LogHook string AppName string PapertrailHost string PapertrailPort int PapertrailTag string }
func (Configuration) Apply ¶
func (c Configuration) Apply()
type LogfLogger ¶ added in v0.2.0
type LogfLogger Level
func NewLogf ¶ added in v0.2.0
func NewLogf(level Level) LogfLogger
func (LogfLogger) Logf ¶ added in v0.2.0
func (l LogfLogger) Logf(format string, argv ...interface{})
type SyslogHook ¶
func NewSyslogLocalHook ¶
func NewSyslogLocalHook(priority syslog.Priority, tag string) (*SyslogHook, error)
func NewSyslogNetworkHook ¶
func (*SyslogHook) Levels ¶
func (hook *SyslogHook) Levels() []logrus.Level
Source Files ¶
Click to show internal directories.
Click to hide internal directories.