logger

package
v2.0.0-beta.1+incompat... Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2016 License: Apache-2.0 Imports: 5 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 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 Warn

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

Warn logs a message with severity WARNING.

Types

type LogFormatter

type LogFormatter struct{}

LogFormatter is used to format log entry.

func (*LogFormatter) Format

func (c *LogFormatter) Format(entry *log.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