From f649c97eb1e156bf9ac34e17a630e690694db7bc Mon Sep 17 00:00:00 2001 From: carbotaniuman <41451839+carbotaniuman@users.noreply.github.com> Date: Sun, 24 Jan 2021 21:00:56 -0600 Subject: [PATCH] Normalize log levels --- src/main/kotlin/mdnet/server/ImageServer.kt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/kotlin/mdnet/server/ImageServer.kt b/src/main/kotlin/mdnet/server/ImageServer.kt index 4d569c1..ad97ff5 100644 --- a/src/main/kotlin/mdnet/server/ImageServer.kt +++ b/src/main/kotlin/mdnet/server/ImageServer.kt @@ -141,7 +141,7 @@ class ImageServer( val mdResponse = client(Request(Method.GET, sanitizedUri)) if (mdResponse.status != Status.OK) { - LOGGER.trace { "Upstream query for $sanitizedUri errored with status ${mdResponse.status}" } + LOGGER.warn { "Upstream query for $sanitizedUri errored with status ${mdResponse.status}" } mdResponse.close() return Response(mdResponse.status) @@ -159,7 +159,7 @@ class ImageServer( // bad upstream responses mean we can't cache, so bail if (contentLength == null || lastModified == null) { - LOGGER.trace { "Request for $sanitizedUri is being served due to upstream issues" } + LOGGER.info { "Request for $sanitizedUri is being served due to upstream issues" } return respondWithImage(mdResponse.body.stream, contentLength, contentType, lastModified, false) } @@ -170,7 +170,7 @@ class ImageServer( // A null writer means that this file is being written to // concurrently so we skip the cache process return if (writer != null) { - LOGGER.trace { "Request for $sanitizedUri is being cached and served" } + LOGGER.info { "Request for $sanitizedUri is being cached and served" } val tee = CachingInputStream( mdResponse.body.stream, @@ -180,7 +180,7 @@ class ImageServer( if (writer.commit(contentLength)) { LOGGER.info { "Cache download for $sanitizedUri committed" } } else { - LOGGER.warn { "Cache download for $sanitizedUri aborted" } + LOGGER.info { "Cache download for $sanitizedUri aborted" } } } catch (e: Exception) { LOGGER.warn(e) { "Cache go/no go for $sanitizedUri failed" } @@ -188,7 +188,7 @@ class ImageServer( } respondWithImage(tee, contentLength, contentType, lastModified, false) } else { - LOGGER.trace { "Request for $sanitizedUri is being served" } + LOGGER.info { "Request for $sanitizedUri is being served" } respondWithImage(mdResponse.body.stream, contentLength, contentType, lastModified, false) } } @@ -284,8 +284,8 @@ fun getServer( } ) - return addCommonHeaders() - .then(timeRequest()) + return timeRequest() + .then(addCommonHeaders()) .then(catchAllHideDetails()) .then( routes(