Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertLogrusLevelToSlf4goLevel ¶
ConvertLogrusLevelToSlf4goLevel converts a log level from logrus to slf4go.
func ConvertSlf4goLevelToLogrusLevel ¶
ConvertSlf4goLevelToLogrusLevel converts a log level from slf4go to logrus.
func InitLogger ¶
InitLogger creates and returns a new logger instance based on the specified command line logger level flag.
Types ¶
type LogrusDriver ¶
type LogrusDriver struct { // LoggerToLevelMapping allows you to specify a logger name that you want to assign a specific log level LoggerToLevelMapping map[string]slog.Level // When enabled the logger name is appended to the start of all log lines PrependLoggerName bool }
LogrusDriver is a slf4go compatible logger implementation.
func (*LogrusDriver) GetLevel ¶
func (ld *LogrusDriver) GetLevel(logger string) slog.Level
GetLevel retrieves the log level of the specified logger, it should return the lowest Level that could be print, which can help invoker to decide whether prepare print or not.
func (*LogrusDriver) Name ¶
func (ld *LogrusDriver) Name() string
Name indicates the name of the logger implementation.
func (*LogrusDriver) Print ¶
func (ld *LogrusDriver) Print(sl *slog.Log)
Print outputs the log line using the backing logrus driver implementation.
Click to show internal directories.
Click to hide internal directories.