logger

package
v0.7.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger interface {
	logrus.FieldLogger
	Tracef(format string, args ...interface{})
	Trace(args ...interface{})
	Traceln(args ...interface{})
}

Logger defines the logger interface we need.

It is identical to logrus.Ext1FieldLogger but we are not using that because it's marked as "Do not use". Instead, we're defining our own in order to be sure that potential Logrus changes won't break us.

type SkyLogger added in v0.6.0

type SkyLogger struct {
	*logrus.Logger
	// contains filtered or unexported fields
}

SkyLogger is a wrapper of *logrus.Logger which allows logging to a file on disk.

func New

func New(level logrus.Level, logfile string) (logger *SkyLogger, err error)

New creates a new SkyLogger that can optionally write to disk.

If the given logfile argument is an empty string, the SkyLogger will not write to disk.

func (*SkyLogger) Close added in v0.6.0

func (l *SkyLogger) Close() error

Close gracefully closes all resources used by SkyLogger.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL