Move zerolog.CallerMarshalFunc to mautrix-go
This commit is contained in:
2
go.mod
2
go.mod
@@ -15,7 +15,7 @@ require (
|
||||
github.com/stretchr/testify v1.8.2
|
||||
github.com/yuin/goldmark v1.5.4
|
||||
maunium.net/go/maulogger/v2 v2.4.1
|
||||
maunium.net/go/mautrix v0.15.2-0.20230505115924-0f35052822c7
|
||||
maunium.net/go/mautrix v0.15.2-0.20230506171416-973e67d55fe0
|
||||
)
|
||||
|
||||
require (
|
||||
|
||||
4
go.sum
4
go.sum
@@ -72,5 +72,5 @@ maunium.net/go/mauflag v1.0.0 h1:YiaRc0tEI3toYtJMRIfjP+jklH45uDHtT80nUamyD4M=
|
||||
maunium.net/go/mauflag v1.0.0/go.mod h1:nLivPOpTpHnpzEh8jEdSL9UqO9+/KBJFmNRlwKfkPeA=
|
||||
maunium.net/go/maulogger/v2 v2.4.1 h1:N7zSdd0mZkB2m2JtFUsiGTQQAdP0YeFWT7YMc80yAL8=
|
||||
maunium.net/go/maulogger/v2 v2.4.1/go.mod h1:omPuYwYBILeVQobz8uO3XC8DIRuEb5rXYlQSuqrbCho=
|
||||
maunium.net/go/mautrix v0.15.2-0.20230505115924-0f35052822c7 h1:FKSv0JgTa3Ecx0BrPGIWDRoP6dLt94mHcZVhrHn8uVQ=
|
||||
maunium.net/go/mautrix v0.15.2-0.20230505115924-0f35052822c7/go.mod h1:XM6eY4GfAZy2MaVeQrw8K3HjjkEGmiGReG/yWmZIkbM=
|
||||
maunium.net/go/mautrix v0.15.2-0.20230506171416-973e67d55fe0 h1:NBszqQxZQNCFecJzR0EiFtauUmyt8GrGVQDH8aQaf5w=
|
||||
maunium.net/go/mautrix v0.15.2-0.20230506171416-973e67d55fe0/go.mod h1:XM6eY4GfAZy2MaVeQrw8K3HjjkEGmiGReG/yWmZIkbM=
|
||||
|
||||
15
main.go
15
main.go
@@ -18,13 +18,8 @@ package main
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
"fmt"
|
||||
"runtime"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/rs/zerolog"
|
||||
|
||||
"maunium.net/go/mautrix/bridge"
|
||||
"maunium.net/go/mautrix/bridge/commands"
|
||||
"maunium.net/go/mautrix/id"
|
||||
@@ -101,16 +96,6 @@ func (br *DiscordBridge) Init() {
|
||||
|
||||
br.DB = database.New(br.Bridge.DB, br.Log.Sub("Database"))
|
||||
discordLog = br.ZLog.With().Str("component", "discordgo").Logger()
|
||||
|
||||
// TODO move this to mautrix-go?
|
||||
zerolog.CallerMarshalFunc = func(pc uintptr, file string, line int) string {
|
||||
files := strings.Split(file, "/")
|
||||
file = files[len(files)-1]
|
||||
name := runtime.FuncForPC(pc).Name()
|
||||
fns := strings.Split(name, ".")
|
||||
name = fns[len(fns)-1]
|
||||
return fmt.Sprintf("%s:%d:%s()", file, line, name)
|
||||
}
|
||||
}
|
||||
|
||||
func (br *DiscordBridge) Start() {
|
||||
|
||||
Reference in New Issue
Block a user