mirror of
https://github.com/cwinfo/matterbridge.git
synced 2025-07-05 14:04:02 +00:00
Update mattermost library (#2152)
* Update mattermost library * Fix linting
This commit is contained in:
11
vendor/github.com/mattermost/logr/v2/formatters/gelf.go
generated
vendored
11
vendor/github.com/mattermost/logr/v2/formatters/gelf.go
generated
vendored
@ -79,7 +79,7 @@ type gelfRecord struct {
|
||||
func (gr gelfRecord) MarshalJSONObject(enc *gojay.Encoder) {
|
||||
enc.AddStringKey(GelfVersionKey, GelfVersion)
|
||||
enc.AddStringKey(GelfHostKey, gr.getHostname())
|
||||
enc.AddStringKey(GelfShortKey, gr.Msg())
|
||||
enc.AddStringKey(GelfShortKey, gr.safeMsg("-")) // Gelf requires a non-empty `short_message`
|
||||
|
||||
if gr.level.Stacktrace {
|
||||
frames := gr.StackFrames()
|
||||
@ -131,6 +131,15 @@ func (gr gelfRecord) IsNil() bool {
|
||||
return gr.LogRec == nil
|
||||
}
|
||||
|
||||
// safeMsg returns the log record Message field or an alternate string when msg is empty.
|
||||
func (gr gelfRecord) safeMsg(alt string) string {
|
||||
s := gr.Msg()
|
||||
if s == "" {
|
||||
s = alt
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
func (g *Gelf) getHostname() string {
|
||||
if g.Hostname != "" {
|
||||
return g.Hostname
|
||||
|
Reference in New Issue
Block a user