feat: notifications retry mechanism and improved error formatting

This commit is contained in:
yusing
2025-05-03 14:30:40 +08:00
parent 2fe4fef779
commit 82c829de18
9 changed files with 146 additions and 54 deletions

View File

@@ -20,6 +20,26 @@ const (
HighlightWhite = BrightWhite + Bold
)
func Error(s string) string {
return WithANSI(s, HighlightRed)
}
func Success(s string) string {
return WithANSI(s, HighlightGreen)
}
func Warning(s string) string {
return WithANSI(s, HighlightYellow)
}
func Info(s string) string {
return WithANSI(s, HighlightCyan)
}
func WithANSI(s string, ansi string) string {
return ansi + s + Reset
}
func StripANSI(s string) string {
return ansiRegexp.ReplaceAllString(s, "")
}