Help us shape the future of Go! Take the 2026 Go Developer Survey

log

package
v0.18.3 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package log is a wrapper around colorizing the log output. It has functions that allow you to simply write output to the screen for various scenarios.

- Start ==> Blue - Success ==> Green - Info ==> Cyan - Warn ==> Yellow - Error ==> Red - Fatal ==> Red (and exits the program)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(format string, a ...any)

Error prints a message to the terminal in red, indicating an error.

func ErrorWriter added in v0.17.1

func ErrorWriter() *logErrorWriter

ErrorWriter returns a new logErrorWriter for use as an io.Writer for error output.

func Fatal

func Fatal(format string, a ...any)

Fatal prints a message to the terminal in red, then exits the program with an error code.

func Info

func Info(format string, a ...any)

Info prints a message to the terminal in cyan, indicating informational output.

func Message

func Message(format string, a ...any)

Message simply prints a formatted message to the terminal.

func Start

func Start(format string, a ...any)

Start prints a message to the terminal in blue, indicating a starting action.

func Success

func Success(format string, a ...any)

Success prints a message to the terminal in green, indicating a successful action.

func Verbose

func Verbose(v bool, format string, a ...any)

Verbose prints a message to the terminal if v is true, prefixed with '---'.

func Warn

func Warn(format string, a ...any)

Warn prints a message to the terminal in yellow, indicating a warning.

func Writer added in v0.17.1

func Writer() *logWriter

Writer returns a new logWriter for use as an io.Writer for standard output.

Types

This section is empty.

Jump to

Keyboard shortcuts

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