logger

package module
v0.0.0-...-eac18f7 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: Apache-2.0 Imports: 2 Imported by: 8

README

Logger GO

Documentation

Index

Constants

View Source
const (
	InfoState    string = "Info"
	DebugState   string = "Debug"
	WarningState string = "Warning"
	ErrorState   string = "Error"
	FatalState   string = "Fatal"
)

Variables

This section is empty.

Functions

func Debug

func Debug(message ...any)

Logs a debug message to the terminal.

func Error

func Error(message ...any)

Logs a error message to the terminal.

func Fatal

func Fatal(message ...any)

Logs a fatal message to the terminal and exits the program.

func Info

func Info(message ...any)

Logs a info message to the terminal.

func LogEmptySpace

func LogEmptySpace(amount int)

func LogFormatted

func LogFormatted(Severity string, message string, values []string)

Formats provided text while logging it.

func LogNextLine

func LogNextLine(amount int)

func Scan

func Scan(a ...any) (n int, err error)

Scan scans text read from standard input, storing successive space-separated values into successive arguments. Newlines count as space. It returns the number of items successfully scanned. If that is less than the number of arguments, err will report why.

func Scanf

func Scanf(format string, a ...any) (n int, err error)

Scanf scans text read from standard input, storing successive space-separated values into successive arguments as determined by the format. It returns the number of items successfully scanned. If that is less than the number of arguments, err will report why. Newlines in the input must match newlines in the format. The one exception: the verb %c always scans the next rune in the input, even if it is a space (or tab etc.) or newline.

func Scanln

func Scanln(a ...any) (n int, err error)

Scanln is similar to Scan, but stops scanning at a newline and after the final item there must be a newline or EOF.

func Sscan

func Sscan(str string, a ...any) (n int, err error)

Sscan scans the argument string, storing successive space-separated values into successive arguments. Newlines count as space. It returns the number of items successfully scanned. If that is less than the number of arguments, err will report why.

func Sscanf

func Sscanf(str string, format string, a ...any) (n int, err error)

Sscanf scans the argument string, storing successive space-separated values into successive arguments as determined by the format. It returns the number of items successfully parsed. Newlines in the input must match newlines in the format.

func Sscanln

func Sscanln(str string, a ...any) (n int, err error)

Sscanln is similar to Sscan, but stops scanning at a newline and after the final item there must be a newline or EOF.

func Warning

func Warning(message ...any)

Logs a warning message to the terminal.

Types

type ILogger

type ILogger struct {
	// Formats provided text and logs it to the terminal.
	Format func(string, []string)
	// Logs a message to the terminal with the given configuration.
	Log func(...any)
}

func ConfigureLogger

func ConfigureLogger(config LoggerConfig) *ILogger

type LoggerConfig

type LoggerConfig struct {
	Severity string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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