logger

package
v0.0.0-...-19ad383 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2021 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseLog

func CloseLog()

CloseLog closes the open file handler for our current logfile

func LogChat

func LogChat(l ILogger, m string, chs ...chan []byte)

LogChat logs server chat

func LogDebug

func LogDebug(l ILogger, m string, chs ...chan []byte)

LogDebug logs a debug message if the loglevel of the given object is three or greater

func LogError

func LogError(l ILogger, m string, chs ...chan []byte)

LogError logs an error.

func LogHTTP

func LogHTTP(l ILogger, rc int, r *http.Request, chs ...chan []byte)

LogHTTP logs an HTTP response code and string. Provides formatting for the response, and will output if the loglevel of the object is 1 or greater

func LogInfo

func LogInfo(l ILogger, m string, chs ...chan []byte)

LogInfo logs an informational notification if the loglevel is one or greater

func LogInit

func LogInit(l ILogger, m string, chs ...chan []byte)

LogInit logs an initialization message

func LogOutput

func LogOutput(l ILogger, m string, chs ...chan []byte)

LogOutput logs the given string with a timestamp and no prefix. Logging does not depend on the current loglevel of an object

func LogVerbose

func LogVerbose(l ILogger, m string, chs ...chan []byte)

LogVerbose logs a message only when the loglevel of an object is 2 or greater

func LogWarning

func LogWarning(l ILogger, m string, chs ...chan []byte)

LogWarning logs a warning

func SetFile

func SetFile(path string)

SetFile sets the programs logfile when provided a string

Types

type ILogger

type ILogger interface {
	UUID() string
	Loglevel() int
	SetLoglevel(int)
}

ILogger describes an interface to an object that can log

Jump to

Keyboard shortcuts

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