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. 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 for now, a type alias of Logrus.FieldLogger that defines a broad interface for logging.
func NewDerivedLoggerWithField ¶ added in v0.5.0
NewDerivedLoggerWithField returns a logger that inherits all properties of the parent logger, and add the given fields for each log entry.
Panics if parent logger is nil.
func NewLogger ¶ added in v0.6.0
func NewLogger() Logger
NewLogger returns the package level logger.
If the internal logger instance is not initialized before this call, it is initialized to "debug" level and logs to the standard output (stdout).
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).