log

package
v0.0.0-...-c94d6c2 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package log implements the logging for the bolt driver

There are 3 logging levels - trace, info and error. Setting trace would also set info and error logs. You can use the SetLevel("trace") to set trace logging, for example.

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrorLog is the logger for error logging. This can be manually overridden.
	ErrorLog = l.New(os.Stderr, "[BOLT][ERROR]", l.LstdFlags)
	// InfoLog is the logger for info logging. This can be manually overridden.
	InfoLog = l.New(os.Stderr, "[BOLT][INFO]", l.LstdFlags)
	// TraceLog is the logger for trace logging. This can be manually overridden.
	TraceLog = l.New(os.Stderr, "[BOLT][TRACE]", l.LstdFlags)
)

Functions

func Error

func Error(args ...interface{})

Error writes an error log in the format of Println

func Errorf

func Errorf(msg string, args ...interface{})

Errorf writes an error log in the format of Printf

func Fatal

func Fatal(args ...interface{})

Fatal writes an error log in the format of Fatalln

func Fatalf

func Fatalf(msg string, args ...interface{})

Fatalf writes an error log in the format of Fatalf

func Info

func Info(args ...interface{})

Info writes an info log in the format of Println

func Infof

func Infof(msg string, args ...interface{})

Infof writes an info log in the format of Printf

func Panic

func Panic(args ...interface{})

Panic writes an error log in the format of Panicln

func Panicf

func Panicf(msg string, args ...interface{})

Panicf writes an error log in the format of Panicf

func SetLevel

func SetLevel(levelStr string)

SetLevel sets the logging level of this package. levelStr should be one of "trace", "info", or "error

func Trace

func Trace(args ...interface{})

Trace writes a trace log in the format of Println

func Tracef

func Tracef(msg string, args ...interface{})

Tracef writes a trace log in the format of Printf

Types

type Level

type Level int

Level is the logging level

const (
	// NoneLevel is no logging
	NoneLevel Level = iota
	// ErrorLevel is error logging
	ErrorLevel Level = iota
	// InfoLevel is info logging
	InfoLevel Level = iota
	// TraceLevel is trace logging
	TraceLevel Level = iota
)

func GetLevel

func GetLevel() Level

GetLevel gets the logging level

Jump to

Keyboard shortcuts

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