Documentation
¶
Overview ¶
Package log implements a simple logger that directly uses the logrus library. It can initializes multiple instances, each of which log with their own fields and are safe for concurrent use.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitLogger ¶
InitLogger sets the internal logger instance to the given level and log file. This function should be called exactly once and subsequent calls return an error. Logs to stdout if logFile is an empty string.
It also initializes the logger in the go-perun library.
Types ¶
type Logger ¶
type Logger = logrus.FieldLogger
Logger is a for now, a type alias of Logrus.FieldLogger that defines a broad interface for logging.
func NewLoggerWithField ¶
NewLoggerWithField returns a logger that logs with the given fields. It is derived from the internal logger instance of this package and uses the same log level and log file.
If the internal logger instance is not initialized before this call, it is initialized to "debug" level and logs to the standard output (stdout).