logger

package
v2.8.4 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package logger provides functions that are logging related

Index

Constants

View Source
const (
	YELLOW = "\x1b[33;1m"
	GREEN  = "\x1b[32;1m"
	RED    = "\x1b[31;1m"
	RESET  = "\x1b[33;0m"
)

Colors which can be used

Variables

This section is empty.

Functions

func Error

func Error(format string, a ...interface{})

Error prints an error message to Stdout in red

func Output

func Output(format string, a ...interface{})

Output prints an error message to Stdout in 'normal' color

func Print

func Print(message string)

Print prints a message

func PrintColor

func PrintColor(message string, color string)

PrintColor prints a message in a given ANSI-color

func Println

func Println(message string)

Println prints a message with a trailing newline

func PrintlnColor

func PrintlnColor(message string, color string)

PrintlnColor prints a message in a given ANSI-color with a trailing newline

func Warning

func Warning(format string, a ...interface{})

Warning prints a warning message to Stdout in yellow

Types

type Logger

type Logger struct {
	Verbosee bool
	Debugg   bool
	NoColor  bool
}

Logger struct

func (Logger) Debug

func (l Logger) Debug(format string, a ...interface{})

Debug prints a message when Debugg is set to true on the Logger

func (Logger) Error

func (l Logger) Error(format string, a ...interface{})

Error prints an error message to Stdout in red

func (Logger) Output

func (l Logger) Output(format string, a ...interface{})

Output prints a message on Stdout in 'normal' color

func (Logger) Verbose

func (l Logger) Verbose(format string, a ...interface{})

Verbose prints a message when Verbosee is set to true on the Logger

func (Logger) Warning

func (l Logger) Warning(format string, a ...interface{})

Warning prints a warning message to Stdout in yellow

Jump to

Keyboard shortcuts

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