Documentation ¶
Index ¶
- Constants
- func Debug(format string, a ...interface{})
- func Error(format string, a ...interface{})
- func ErrorAndNotify(title string, format string, a ...interface{})
- func Fatal(format string, a ...interface{})
- func FatalWithoutStacktrace(format string, a ...interface{})
- func Info(format string, a ...interface{})
- func NotifyError(title, text string)
- func NotifyInfo(title, text string)
- func NotifySend(urgency, title, text, icon string)
- func NotifyWarn(title, text string)
- func Printf(format string, a ...interface{})
- func Printfln(format string, a ...interface{})
- func SetDebugEnabled(enabled bool)
- func Success(format string, a ...interface{})
- func Warning(format string, a ...interface{})
- func WarningAndNotify(title string, format string, a ...interface{})
Examples ¶
Constants ¶
View Source
const ( IconDialogError = "dialog-error" IconDialogInfo = "dialog-information" IconDialogWarn = "dialog-warning" UrgencyLow = "low" UrgencyNormal = "normal" UrgencyCritical = "critical" )
For a list of possible icons, see: https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html
Variables ¶
This section is empty.
Functions ¶
func Debug ¶
func Debug(format string, a ...interface{})
Example ¶
pterm.SetDefaultOutput(os.Stdout) pterm.DisableStyling() pterm.PrintDebugMessages = true msg := "This is a test: %d" a := 5 Debug(msg, a)
Output: DEBUG: This is a test: 5
func Error ¶
func Error(format string, a ...interface{})
Example ¶
pterm.SetDefaultOutput(os.Stdout) pterm.DisableStyling() msg := "This is a test: %v" a := os.ErrClosed Error(msg, a)
Output: ERROR: This is a test: file already closed
func ErrorAndNotify ¶
func FatalWithoutStacktrace ¶
func FatalWithoutStacktrace(format string, a ...interface{})
func Info ¶
func Info(format string, a ...interface{})
Example ¶
pterm.SetDefaultOutput(os.Stdout) pterm.DisableStyling() msg := "This is a test: %d" a := 5 Info(msg, a)
Output: INFO: This is a test: 5
func NotifyError ¶
func NotifyError(title, text string)
func NotifyInfo ¶
func NotifyInfo(title, text string)
func NotifySend ¶
func NotifySend(urgency, title, text, icon string)
func NotifyWarn ¶
func NotifyWarn(title, text string)
func SetDebugEnabled ¶
func SetDebugEnabled(enabled bool)
func Warning ¶
func Warning(format string, a ...interface{})
Example ¶
pterm.SetDefaultOutput(os.Stdout) pterm.DisableStyling() msg := "This is a test: %d" a := 5 Warning(msg, a)
Output: WARNING: This is a test: 5
func WarningAndNotify ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.