Documentation ¶
Overview ¶
Package log provides a set of functions for logging to the console and storing the output in a buffer
Index ¶
- func ActionLog(Header string, char rune)
- func ActionLogDT(Header string, char rune)
- func ActionLogDateFail(Header string, char rune)
- func ActionLogDateOK(Header string, char rune)
- func ActionLogFail(Header string, char rune)
- func ActionLogGreen(Header string, char rune)
- func ActionLogOK(Header string, char rune)
- func ActionLogRed(Header string, char rune)
- func FormatResults(title string, data interface{}, format string) error
- func LogInterfaceVerbose(data interface{})
- func LogVerbose(msg string)
- func PrintFail(msg string)
- func PrintOK(msg string)
- func PrintlnFail(msg string)
- func PrintlnOK(msg string)
- type LogStreamer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActionLog ¶
ActionLog It takes a string and a rune as input, and prints a header with the string in the middle, and the rune as the border - Header: the string to print in the middle of the header - char: the rune to use as the border
func ActionLogDT ¶ added in v0.2.1
ActionLogDT is a function that takes a string and a rune as arguments and prints a header with the string , and the rune as the border It also prints the date and time in the middle of the header - Header: the string to print in the middle of the header - char: the rune to use as the border
func ActionLogDateFail ¶ added in v0.2.1
ActionLogDateFail() is a function that takes a string and a rune as arguments and print a red "Fail" message to the console with a red border and the date and time - Header: the string to print in the middle of the header - char: the rune to use as the border
func ActionLogDateOK ¶ added in v0.2.1
ActionLogDateOK() is a function that takes a string and a rune as arguments and print a green "OK" message to the console with a green border and the date and time - Header: the string to print in the middle of the header - char: the rune to use as the border
func ActionLogFail ¶
ActionLogFail() is a function that takes a string and a rune as arguments and prints a red "Fail" message to the console - Header: the string to print in the middle of the header - char: the rune to use as the border
func ActionLogGreen ¶ added in v0.2.2
ActionLogGreen() is a function that takes a string and a rune as arguments and returns nothing It prints a green "OK" message to the console with green border - Header: the string to print in the middle of the header - char: the rune to use as the border
func ActionLogOK ¶
ActionLogOK() is a function that takes a string and a rune as arguments and returns nothing It prints a green "OK" message to the console - Header: the string to print in the middle of the header - char: the rune to use as the border
func ActionLogRed ¶ added in v0.2.2
ActionLogRed() is a function that takes a string and a rune as arguments and prints a red "Fail" message to the console with a red border - Header: the string to print in the middle of the header - char: the rune to use as the border
func FormatResults ¶
`FormatResults` is a function that takes a string, an interface and a string as arguments and formats the data before printing it to the console - title: the string to print in the middle of the header - data: the interface to print - format: the format to use to print the data
- json
- yaml
- toml
- xml
- plain
- default: json
- returns an error
func LogInterfaceVerbose ¶
func LogInterfaceVerbose(data interface{})
`LogInterfaceVerbose` is a function that takes an interface and prints it to the console in magenta - data: the interface to print
func LogVerbose ¶
func LogVerbose(msg string)
`LogVerbose` is a function that takes a string and prints it to the console in magenta - msg: the string to print
func PrintFail ¶
func PrintFail(msg string)
`PrintFail` prints a message and fail in red color - msg: the string to print
func PrintOK ¶
func PrintOK(msg string)
`PrintOK` prints a message and OK in green color - msg: the string to print
func PrintlnFail ¶
func PrintlnFail(msg string)
`PrintlnFail` prints a message and fail in red color - msg: the string to print
Types ¶
type LogStreamer ¶
type LogStreamer struct {
// contains filtered or unexported fields
}
LogStreamer is a io.Writer that logs to the console and stores the output in a buffer
func (*LogStreamer) String ¶
func (l *LogStreamer) String() string
Gets the log streamer output as a string