Skip to content

Logging

Roman edited this page Aug 23, 2022 · 2 revisions

gotaskr provides a few methods to add log messages.

One to log information and another to log debug messages. The debug messages are not shown unless you pass the --verbose or -v argument when running a task.

There is also a constant for a newline: log.Newline

Examples:

// Plain information
log.Information("Info")
log.Debug("Debug")

// Formatted
log.Informationf("%s element(s) found", len(myArray))
log.Debugf("%s item(s) cleaned", len(cleanedElements))
Clone this wiki locally