log

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AvailableDates added in v1.3.0

func AvailableDates() []string

AvailableDates returns the dates that have a log file, newest first.

func Failure

func Failure(command, profile, message string, start time.Time)

Failure records a failed operation

func Info

func Info(command, profile, message string)

Info logs an informational entry

func LogPath added in v1.3.0

func LogPath(date string) string

LogPath returns the file that holds the entries for a date. An empty date means today.

func Success

func Success(command, profile, message string, start time.Time)

Success records a success entry

Types

type Entry

type Entry struct {
	Timestamp string `json:"timestamp"`
	Command   string `json:"command"`
	Profile   string `json:"profile"`
	Status    string `json:"status"`
	Message   string `json:"message"`
	Duration  string `json:"duration"`
}

func Entries added in v1.3.0

func Entries(date string) ([]Entry, error)

Entries returns the log entries recorded on a date, oldest first. An empty date means today.

A missing file is not an error: it means nothing was logged that day, which is the normal state on a machine that has not run a command yet.

Jump to

Keyboard shortcuts

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