Skipping regex path removal.

This commit is contained in:
Daniel Swärd
2023-01-26 12:58:07 +01:00
parent cca0c8d44d
commit f7b51d6dfa

View File

@@ -4,7 +4,6 @@ import (
"context"
"fmt"
"os"
"regexp"
"runtime"
"strings"
"time"
@@ -19,10 +18,6 @@ import (
var (
RequestIDString = "request-id"
// Match all paths outside of ocis. Will break if path does not include '/ocis/',
// but this is intended for debugging purposes.
pathRegex = regexp.MustCompile(`.*/ocis/`)
)
func init() {
@@ -78,7 +73,6 @@ type LineInfoHook struct{}
func (h LineInfoHook) Run(e *zerolog.Event, l zerolog.Level, msg string) {
_, file, line, ok := runtime.Caller(3)
if ok {
file := pathRegex.ReplaceAllString(file, "")
e.Str("line", fmt.Sprintf("%s:%d", file, line))
}
}