Documentation ¶
Index ¶
- Constants
- Variables
- func Line(prefix, msg string)
- func LineAndSay(prefix, msg string)
- func LineAndSayf(prefix, format string, args ...interface{})
- func LineBytes(prefix string, msg []byte)
- func LineStream(prefix string, msg io.Reader)
- func Linef(prefix, format string, args ...interface{})
- func RotateAndOpenLogfile(cloudHome, logPath string, force bool) (io.WriteCloser, error)
- func Setup(cloudHome, logPath string, useStderr, forceRotate bool) error
Constants ¶
const (
// File is the default location of the current log file.
File = "log/genifest.log"
)
Variables ¶
var (
LogCloser io.Closer // provides a closer when needed
)
Functions ¶
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 LineStream ¶
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.
Types ¶
This section is empty.