log

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2021 License: AGPL-3.0 Imports: 8 Imported by: ? 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

View Source
const ErrFmt = `${time_rfc3339_nano}: ${level} ` + "\t" + `▶ ${prefix} ${short_file}:${line}`

ErrFmt holds the format for all the console logging

View Source
const Fmt = `%{color}%{time:` + time.RFC3339Nano + `}: %{level}` + "\t" + `▶ %{shortpkg}/%{shortfunc} %{id:03x}%{color:reset} %{message}`

Fmt is the general log format

View Source
const WebFmt = `${time_rfc3339_nano}: WEB ` + "\t" + `▶ ${remote_ip} ${id} ${method} ${status} ${uri} ${latency_human} - ${user_agent}`

WebFmt holds the format for all logging related to web requests

View Source
const XormFmt = `%{color}%{time:` + time.RFC3339Nano + `}: %{level}` + "\t" + `▶ [DATABASE] %{id:03x}%{color:reset} %{message}`

XormFmt defines the format for xorm logging strings

Variables

This section is empty.

Functions

func Critical

func Critical(args ...interface{})

Critical is for critical messages

func Criticalf

func Criticalf(format string, args ...interface{})

Criticalf is for critical messages

func Debug

func Debug(args ...interface{})

Debug is for debug messages

func Debugf

func Debugf(format string, args ...interface{})

Debugf is for debug messages

func Error

func Error(args ...interface{})

Error is for error messages

func Errorf

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

Errorf is for error messages

func Fatal

func Fatal(args ...interface{})

Fatal is for fatal messages

func Fatalf

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

Fatalf is for fatal messages

func GetLogWriter

func GetLogWriter(logfile string) (writer io.Writer)

GetLogWriter returns the writer to where the normal log goes, depending on the config

func GetLogger

func GetLogger() *logging.Logger

GetLogger returns the logging instance. DO NOT USE THIS TO LOG STUFF.

func Info

func Info(args ...interface{})

Info is for info messages

func Infof

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

Infof is for info messages

func InitLogger

func InitLogger()

InitLogger initializes the global log handler

func Warning

func Warning(args ...interface{})

Warning is for warning messages

func Warningf

func Warningf(format string, args ...interface{})

Warningf is for warning messages

Types

type XormLogger

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

XormLogger holds an implementation of the xorm logger interface.

func NewXormLogger

func NewXormLogger(lvl string) *XormLogger

NewXormLogger creates and initializes a new xorm logger

func (*XormLogger) Debug

func (x *XormLogger) Debug(v ...interface{})

Debug logs a debug string

func (*XormLogger) Debugf

func (x *XormLogger) Debugf(format string, v ...interface{})

Debugf logs a debug string

func (*XormLogger) Error

func (x *XormLogger) Error(v ...interface{})

Error logs a debug string

func (*XormLogger) Errorf

func (x *XormLogger) Errorf(format string, v ...interface{})

Errorf logs a debug string

func (*XormLogger) Info

func (x *XormLogger) Info(v ...interface{})

Info logs an info string

func (*XormLogger) Infof

func (x *XormLogger) Infof(format string, v ...interface{})

Infof logs an info string

func (*XormLogger) IsShowSQL

func (x *XormLogger) IsShowSQL() bool

IsShowSQL returns if sql queries should be shown

func (*XormLogger) Level

func (x *XormLogger) Level() log.LogLevel

Level returns the current set log level

func (*XormLogger) SetLevel

func (x *XormLogger) SetLevel(l log.LogLevel)

SetLevel sets the log level

func (*XormLogger) ShowSQL

func (x *XormLogger) ShowSQL(show ...bool)

ShowSQL sets whether to show the log level or not

func (*XormLogger) Warn

func (x *XormLogger) Warn(v ...interface{})

Warn logs a warning string

func (*XormLogger) Warnf

func (x *XormLogger) Warnf(format string, v ...interface{})

Warnf logs a warning string

Jump to

Keyboard shortcuts

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