log

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DebugFunc logs a message as debug.
	// Set to nil if you want debug logs are ignored.
	DebugFunc = func(format string, v ...any) {
		format = "[DEBUG] vex: " + format
		stdlog.Printf(format, v...)
	}

	// InfoFunc logs a message as info.
	// Set to nil if you want info logs are ignored.
	InfoFunc = func(format string, v ...any) {
		format = "[INFO] vex: " + format
		stdlog.Printf(format, v...)
	}

	// ErrorFunc logs a message as error.
	// Set to nil if you want error logs are ignored.
	ErrorFunc = func(err error, format string, v ...any) {
		format = "[ERROR] vex: " + format + ": %+v"
		stdlog.Printf(format, append(v, err)...)
	}
)

Functions

func Debug

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

Debug logs a debug message.

func DisableAll

func DisableAll()

DisableAll disables the output of all logs.

func DisableDebug

func DisableDebug()

DisableDebug disables the output of debug logs.

func DisableError

func DisableError()

DisableError disables the output of error logs.

func DisableInfo

func DisableInfo()

DisableInfo disables the output of info logs.

func Error

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

Error logs an error message.

func Info

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

Info logs an info message.

Types

This section is empty.

Jump to

Keyboard shortcuts

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