logger

package
v0.0.0-...-efb87f3 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Reset = "\033[0m"

	Black   = "\033[30m"
	Red     = "\033[31m"
	Green   = "\033[32m"
	Yellow  = "\033[33m"
	Blue    = "\033[34m"
	Purple  = "\033[35m"
	Cyan    = "\033[36m"
	White   = "\033[37m"
	Default = "\033[39m"
)

Colors for use with Log.

Variables

This section is empty.

Functions

func Debug

func Debug(pkg string, format string, args ...interface{})

Debug will log pure debug information to stderr.

func DebugLogger

func DebugLogger(pkg string) *log.Logger

DebugLogger will return a log.Logger.

func Info

func Info(pkg string, format string, args ...interface{})

Info will log something for the end user to stderr.

func InfoLogger

func InfoLogger(pkg string) *log.Logger

InfoLogger will return a log.Logger.

Types

type Log

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

Log is for printing logs. Well, duh :)

func New

func New(w io.Writer, color string, packages string) *Log

New will return a new logger.

func (*Log) Log

func (l *Log) Log(pkg string, format string, args ...interface{})

Log will log a message according to format.

func (*Log) Logger

func (l *Log) Logger(pkg string) *log.Logger

Logger will return a log.Logger.

func (*Log) Printf

func (l *Log) Printf(pkg string, format string, args ...interface{})

Printf will print a log entry according to format.

func (*Log) Write

func (l *Log) Write(p []byte) (n int, err error)

Write implements io.Writer for log.New().

Jump to

Keyboard shortcuts

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