Documentation ¶
Index ¶
- Variables
- func NewLogger(logFilename string, logLevel string, logSize int) *logrus.Logger
- func SetGlobalLogger(logFilename string, logLevel string)
- func ToLogFile(filename string) io.Writer
- func ToNull() io.Writer
- func ToStdOut() io.Writer
- type Fields
- type FileLogHook
- type LogFormat
- type Logger
- type Options
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // logger instance used by the application Global *logrus.Logger )
Functions ¶
func SetGlobalLogger ¶ added in v0.29.0
func ToLogFile ¶ added in v0.29.0
ToLogFile returns an io.Writer to configure WithOutput() option to write to a file and manage log rotation using lumberjack.
Types ¶
type FileLogHook ¶ added in v0.29.0
logrus hook to write log to file
func (*FileLogHook) Fire ¶ added in v0.29.0
func (hook *FileLogHook) Fire(entry *logrus.Entry) error
func (*FileLogHook) Levels ¶ added in v0.29.0
func (hook *FileLogHook) Levels() []logrus.Level
type Options ¶ added in v0.29.0
type Options func(*Logger)
Options is a function type that can be used to configure the logger
func WithLevel ¶ added in v0.29.0
WithLevel configures the log level. If level is not specified, default to InfoLevel If level is debug or trace, report caller is enabled
func WithNullLogger ¶ added in v0.29.0
func WithNullLogger() Options
WithNullLogger sets the logger to discard all output
func WithOutput ¶ added in v0.29.0
WithOutput configures the output destination
Click to show internal directories.
Click to hide internal directories.