mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-19 20:32:35 +02:00
21 lines
388 B
Go
21 lines
388 B
Go
package notif
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
|
|
"github.com/sirupsen/logrus"
|
|
U "github.com/yusing/go-proxy/internal/utils"
|
|
)
|
|
|
|
func FieldsAsTitle(entry *logrus.Entry) string {
|
|
if len(entry.Data) == 0 {
|
|
return ""
|
|
}
|
|
var parts []string
|
|
for k, v := range entry.Data {
|
|
parts = append(parts, fmt.Sprintf("%s: %s", k, v))
|
|
}
|
|
parts[0] = U.Title(parts[0])
|
|
return strings.Join(parts, ", ")
|
|
}
|