logging

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package logging provides a global logger for the CLI.

The global logger's standard methods (i.e., log.Infof, log.Debugf, etc.) write log entries to disk under ~/.validator/validator-<timestamp>/logs/validator.log.

The ErrorCLI, FatalCLI, and InfoCLI method logs entries to the console. They are used to guide users through an interactive TUI experience.

Index

Constants

This section is empty.

Variables

View Source
var (

	// Newline determines whether a newline character is appended to the end of each log message.
	Newline = true
)

Functions

func Debug

func Debug(format string, v ...interface{})

Debug ...

func Error

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

Error ...

func ErrorCLI

func ErrorCLI(msg string, args ...any)

ErrorCLI prints an error message to the terminal & creates a log entry

func FatalCLI

func FatalCLI(msg string, args ...any)

FatalCLI prints a message to the terminal & exits

func Header(s string)

Header prints a header to the console

func HeaderCustom

func HeaderCustom(s string, bgColor, textColor pterm.Color)

HeaderCustom prints a header to the console with custom colors

func Info

func Info(format string, v ...interface{})

Info ...

func InfoCLI

func InfoCLI(format string, v ...interface{})

InfoCLI prints an info message to the terminal & creates a log entry

func Out added in v0.1.0

func Out() io.Writer

Out returns the global logger's io.Writer

func SetLevel

func SetLevel(logLevel string)

SetLevel sets the log level for the logger

func SetOutput added in v0.1.2

func SetOutput(runLoc string)

SetOutput sets the output location for the logger

func Warn

func Warn(format string, v ...interface{})

Warn ...

Types

This section is empty.

Jump to

Keyboard shortcuts

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