log

package
v0.0.0-...-a23bd61 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2020 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GREEN   = "\x1b[32m"
	BLUE    = "\x1b[34m"
	YELLOW  = "\x1b[33m"
	YELLOWB = "\x1b[1;33m"
	RED     = "\x1b[31m"
	//REDB    = "\x1b[1;31m"
	ORANGE = "\x1b[38;5;208m"
	RESET  = "\x1b[0m"
)

Variables

This section is empty.

Functions

func Debug

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

func Error

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

func Fatal

func Fatal(v ...interface{})

func Fatalf

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

func Info

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

func InfoWithFields

func InfoWithFields(fields Fields, format string, v ...interface{})

func Notice

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

func Printf

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

To be compatible with standard logging, promote to info.

func Println

func Println(v ...interface{})

Promote to info...

func SetLevel

func SetLevel(level LogLevel)

func Timestamp

func Timestamp() string

func Warning

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

Types

type ColorPrinter

type ColorPrinter func(v interface{}) string
var Blue ColorPrinter = noColorPrinter
var Green ColorPrinter = noColorPrinter
var Orange ColorPrinter = noColorPrinter
var Red ColorPrinter = noColorPrinter
var Yellow ColorPrinter = noColorPrinter
var YellowB ColorPrinter = noColorPrinter

type Fields

type Fields map[string]interface{}

type LogLevel

type LogLevel int
const (
	ERROR LogLevel = iota
	WARNING
	NOTICE
	INFO
	DEBUG
)

func GetLevel

func GetLevel() LogLevel

Jump to

Keyboard shortcuts

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