refactor: notifications

This commit is contained in:
yusing
2025-05-02 05:51:15 +08:00
parent 28d9a72908
commit 69ee8495d8
11 changed files with 202 additions and 104 deletions

View File

@@ -14,16 +14,11 @@ type (
logCh chan *LogMessage
providers F.Set[Provider]
}
LogField struct {
Name string `json:"name"`
Value string `json:"value"`
}
LogFields []LogField
LogMessage struct {
Level zerolog.Level
Title string
Extras LogFields
Color Color
Level zerolog.Level
Title string
Body LogBody
Color Color
}
)
@@ -53,7 +48,7 @@ func Notify(msg *LogMessage) {
}
}
func (f *LogFields) Add(name, value string) {
func (f *FieldsBody) Add(name, value string) {
*f = append(*f, LogField{Name: name, Value: value})
}