diff --git a/exerr/builder.go b/exerr/builder.go index 6578507..9b47ba6 100644 --- a/exerr/builder.go +++ b/exerr/builder.go @@ -112,13 +112,6 @@ func (b *Builder) WithMessage(msg string) *Builder { // ---------------------------------------------------------------------------- -func (b *Builder) WithStackSkip(stacktraceskip int) *Builder { - b.errorData.Caller = callername(stacktraceskip) - return b -} - -// ---------------------------------------------------------------------------- - // Err changes the Severity to ERROR (default) // The error will be: // diff --git a/exerr/exerr.go b/exerr/exerr.go index c9e209b..a6dd2e6 100644 --- a/exerr/exerr.go +++ b/exerr/exerr.go @@ -4,10 +4,7 @@ import ( "github.com/rs/xid" "github.com/rs/zerolog" "gogs.mikescher.com/BlackForestBytes/goext/langext" - "gogs.mikescher.com/BlackForestBytes/goext/rext" "reflect" - "regexp" - "strconv" "strings" "time" ) @@ -80,10 +77,7 @@ func (ee *ExErr) As(target any) bool { } func (ee *ExErr) Log(evt *zerolog.Event) { - backup := zerolog.CallerMarshalFunc - zerolog.CallerMarshalFunc = customZerologCallerMarshalFunc evt.Msg(ee.FormatLog(LogPrintFull)) - zerolog.CallerMarshalFunc = backup } func (ee *ExErr) FormatLog(lvl LogPrintLevel) string { @@ -170,10 +164,7 @@ func (ee *ExErr) FormatLog(lvl LogPrintLevel) string { } func (ee *ExErr) ShortLog(evt *zerolog.Event) { - backup := zerolog.CallerMarshalFunc - zerolog.CallerMarshalFunc = customZerologCallerMarshalFunc ee.Meta.Apply(evt).Msg(ee.FormatLog(LogPrintShort)) - zerolog.CallerMarshalFunc = backup } // RecursiveMessage returns the message to show @@ -305,10 +296,3 @@ func (ee *ExErr) equalsDirectProperties(other *ExErr) bool { func newID() string { return xid.New().String() } - -var regexZerologCallerClean = rext.W(regexp.MustCompile(`^(\.\./)*/?go/pkg/mod/gogs\.(mikescher|blackforestbytes)\.(com|de)/!black!forest!bytes/?`)) - -func customZerologCallerMarshalFunc(pc uintptr, file string, line int) string { - file = regexZerologCallerClean.ReplaceAll(file, "", true) - return file + ":" + strconv.Itoa(line) -} diff --git a/goextVersion.go b/goextVersion.go index 323ad6d..da487d1 100644 --- a/goextVersion.go +++ b/goextVersion.go @@ -1,5 +1,5 @@ package goext -const GoextVersion = "0.0.253" +const GoextVersion = "0.0.254" -const GoextVersionTimestamp = "2023-08-22T10:36:35+0200" +const GoextVersionTimestamp = "2023-08-22T10:49:57+0200"