mirror of
https://github.com/retailcrm/mg-transport-core.git
synced 2024-11-22 13:16:04 +03:00
23 lines
491 B
Go
23 lines
491 B
Go
package logger
|
|
|
|
import "log/slog"
|
|
|
|
const (
|
|
HandlerAttr = "handler"
|
|
ConnectionAttr = "connection"
|
|
AccountAttr = "account"
|
|
CounterIDAttr = "counterId"
|
|
ErrorAttr = "error"
|
|
FailureMessageAttr = "failureMessage"
|
|
HTTPMethodAttr = "httpMethod"
|
|
HTTPStatusAttr = "httpStatusCode"
|
|
HTTPStatusNameAttr = "httpStatusName"
|
|
)
|
|
|
|
func ErrAttr(err any) slog.Attr {
|
|
if err == nil {
|
|
return slog.String(ErrorAttr, "<nil>")
|
|
}
|
|
return slog.Any(ErrorAttr, err)
|
|
}
|