From f7b51d6dfa24787d3527a83c49246e8219fbe9f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sw=C3=A4rd?= Date: Thu, 26 Jan 2023 12:58:07 +0100 Subject: [PATCH] Skipping regex path removal. --- ocis-pkg/log/log.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/ocis-pkg/log/log.go b/ocis-pkg/log/log.go index 46cdfeb36..978ddcbe2 100644 --- a/ocis-pkg/log/log.go +++ b/ocis-pkg/log/log.go @@ -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)) } }