Documentation ¶
Overview ¶
Package logging will handle multi-level logging for the application.
Index ¶
- func AppendStringToFile(path string, input string) error
- func GetLogLevel() string
- func Init(cmd *cobra.Command, _ []string) error
- func Log(format string, v ...any)
- func LogDebug(format string, v ...any)
- func LogError(format string, v ...any)
- func LogWarning(format string, v ...any)
- func ReadLog(file io.Reader, since, until int64, follow, timestamps bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendStringToFile ¶
AppendStringToFile will append input string onto input file.
func Init ¶
Init will initialize the logging to the input level. This is meant to be ran as a PreRunE function in cobra.
func LogDebug ¶
LogDebug will create a debug log in the form of: callerfile.go:line [debug] message...
func LogError ¶
LogError will create an error log in the form of: callerfile.go:line [error] message...
func LogWarning ¶
LogWarning will create a warning log in the form of: callerfile.go:line [warn] message...
func ReadLog ¶
ReadLog will read input file and print. File will be read from since (timestamp) to until (timestamp). File will be continuously read if follow is true. (like tail -f) Timestamps for each line will be shown if timestamps is true. Lines will be printed to stderr or stdout based on where they were meant to be.
Line structure: timestamp:stdout:line
Types ¶
This section is empty.