logger

package
v3.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 26, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package logger provides support for logging to stdout and stderr. Log entries will be logged with format: $timestamp $hostname [$pid]: $severity $message.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckLevel

func CheckLevel(level string) error

CheckLevel checks whether the log level is valid.

func Debug

func Debug(format string, v ...interface{})

Debug logs a message with severity DEBUG.

func Error

func Error(format string, v ...interface{})

Error logs a message with severity ERROR.

func Fatal

func Fatal(format string, v ...interface{})

Fatal logs a message with severity ERROR followed by a call to os.Exit().

func GetLevel

func GetLevel() string

GetLevel get the log level string.

func Info

func Info(format string, v ...interface{})

Info logs a message with severity INFO.

func SetLevel

func SetLevel(level string)

SetLevel sets the log level. Valid levels are "debug", "info", "warn", "error", and "fatal".

func SetOutput

func SetOutput(out io.Writer)

SetOutput set the destination for the log output

func Warn

func Warn(format string, v ...interface{})

Warn logs a message with severity WARN.

Types

type LogFormatter

type LogFormatter struct{}

LogFormatter is used to format log entry.

func (*LogFormatter) Format

func (c *LogFormatter) Format(entry *logrus.Entry) ([]byte, error)

Format formats a given log entry, returns byte slice and error.

Jump to

Keyboard shortcuts

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