log

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2017 License: BSD-3-Clause Imports: 8 Imported by: 0

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()

RemovalRoutine removes logs older than 1 day from database

func SetLevel

func SetLevel(lvl Level)

SetLevel controls the categories of logs written

func SetLogger added in v0.4.0

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 by RamSQL engine

Jump to

Keyboard shortcuts

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