log

package
v0.0.0-...-0f6500d Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2017 License: BSD-3-Clause Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Critical

func Critical(format string, values ...interface{})

Critical prints error informations

func Debug

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

Debug prints debug log

func Fatalf

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

Fatalf prints fatal informations, then os.Exit(1)

func Info

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

Info prints information log

func Initialize

func Initialize()

Initialize initializes log level with flag --log-level

func IsDebug

func IsDebug() bool

IsDebug returns true if current level is DebugLevel

func Notice

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

Notice prints information that should be seen

func RemovalRoutine

func RemovalRoutine(DBFunc func() *sql.DB)

RemovalRoutine removes logs older than 1 day from database

func SetLevel

func SetLevel(lvl Level)

SetLevel controls the categories of logs written

func SetLogger

func SetLogger(l Logger)

SetLogger override private logger reference

func UseDatabaseLogger

func UseDatabaseLogger(db *sql.DB)

UseDatabaseLogger should be used only with proper database

func Warning

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

Warning prints warnings for user

Types

type BaseLogger

type BaseLogger struct {
}

BaseLogger logs on stdout

func (BaseLogger) Logf

func (l BaseLogger) Logf(fmt string, values ...interface{})

Logf logs on stdout

type DatabaseLogger

type DatabaseLogger struct {
	// contains filtered or unexported fields
}

DatabaseLogger logs in database

func (DatabaseLogger) Logf

func (l DatabaseLogger) Logf(format string, values ...interface{})

Logf insert log into "system_log" table

type Level

type Level int

Level of logging trigger

const (
	DebugLevel Level = iota
	InfoLevel
	NoticeLevel
	WarningLevel
	CriticalLevel
)

Available logging levels

type Logger

type Logger interface {
	Logf(fmt string, values ...interface{})
}

Logger defines the logs levels used

Jump to

Keyboard shortcuts

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