From ac6b82ac26c4335af127430531db822e0549f363 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 16 Jan 2020 15:48:20 -0800 Subject: [PATCH 1/2] fix: migrate from deprecated warning function This commit was moved from ipfs/kubo@a53d48059bff98e3a48faf79103651ce301a7ab2 --- gateway/core/corehttp/commands.go | 2 +- gateway/core/corehttp/gateway_handler.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gateway/core/corehttp/commands.go b/gateway/core/corehttp/commands.go index 867805ce2..d63099bfb 100644 --- a/gateway/core/corehttp/commands.go +++ b/gateway/core/corehttp/commands.go @@ -47,7 +47,7 @@ var defaultLocalhostOrigins = []string{ func addCORSFromEnv(c *cmdsHttp.ServerConfig) { origin := os.Getenv(originEnvKey) if origin != "" { - log.Warning(originEnvKeyDeprecate) + log.Warn(originEnvKeyDeprecate) c.AppendAllowedOrigins(origin) } } diff --git a/gateway/core/corehttp/gateway_handler.go b/gateway/core/corehttp/gateway_handler.go index 62d151ee4..de8038f53 100644 --- a/gateway/core/corehttp/gateway_handler.go +++ b/gateway/core/corehttp/gateway_handler.go @@ -610,7 +610,7 @@ func webError(w http.ResponseWriter, message string, err error, defaultCode int) func webErrorWithCode(w http.ResponseWriter, message string, err error, code int) { http.Error(w, fmt.Sprintf("%s: %s", message, err), code) if code >= 500 { - log.Warningf("server error: %s: %s", err) + log.Warnf("server error: %s: %s", err) } } From 5a0b56d141b5811ee9050f08ea723d5ae4957762 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 16 Jan 2020 16:18:53 -0800 Subject: [PATCH 2/2] fix(tracing): remove event tracing We've deprecated this system and have yet to move to a new system. We might as well remove everything, switch to a new system, then deliberately trace the entire system. This commit was moved from ipfs/kubo@906f45edd9899352efba710e2f53978fc4b8c6e4 --- gateway/core/corehttp/logs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gateway/core/corehttp/logs.go b/gateway/core/corehttp/logs.go index 387508b6d..99e8fa885 100644 --- a/gateway/core/corehttp/logs.go +++ b/gateway/core/corehttp/logs.go @@ -50,7 +50,7 @@ func LogOption() ServeOption { w.WriteHeader(200) wnf, errs := newWriteErrNotifier(w) lwriter.WriterGroup.AddWriter(wnf) - log.Event(n.Context(), "log API client connected") + log.Event(n.Context(), "log API client connected") //nolint deprecated <-errs }) return mux, nil