log

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// File is the default location of the current log file.
	File = "log/genifest.log"
)

Variables

View Source
var (
	LogCloser io.Closer // provides a closer when needed

)

Functions

func Line

func Line(prefix, msg string)

Line records a log message with the given prefix.

func LineAndSay

func LineAndSay(prefix, msg string)

LineAndSay records a log message with the given prefix and write the message out to stdout as well.

func LineAndSayf

func LineAndSayf(prefix, format string, args ...interface{})

LineAndSayf records a log message and outputs the message to stdout as well using printf-style formatting.

func LineBytes

func LineBytes(prefix string, msg []byte)

LineBytes records a log message from a byte slice.

func LineStream

func LineStream(prefix string, msg io.Reader)

LineStream records a log message from a stream of data as it arrives.

func Linef

func Linef(prefix, format string, args ...interface{})

Linef records a log message using printf-style formatting.

func RotateAndOpenLogfile

func RotateAndOpenLogfile(cloudHome, logPath string, force bool) (io.WriteCloser, error)

RotateAndOpenLogfile tests to see if the first line of the log is from a different day than today. If so, it will rotate the log file by appending the date of the first entry to the end ofthe log filename and renaming the file to that. It will then open the current log file for append, creating a new log file if one does not exist following rotation.

func Setup

func Setup(cloudHome, logPath string, useStderr, forceRotate bool) error

Setup rotates the log files if the first line is from a different day, then opens up the current log file for append.

Types

This section is empty.

Jump to

Keyboard shortcuts

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