From 8250c7b467159023ce0d9eddbde3717d0bb74401 Mon Sep 17 00:00:00 2001 From: Krateng Date: Fri, 18 Sep 2020 18:56:09 +0200 Subject: [PATCH] Improved API logging slightly --- maloja/apis/_base.py | 3 ++- maloja/apis/native_v1.py | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/maloja/apis/_base.py b/maloja/apis/_base.py index 6e45697..ab7328c 100644 --- a/maloja/apis/_base.py +++ b/maloja/apis/_base.py @@ -67,6 +67,7 @@ class APIHandler: if exceptiontype in self.errors: response.status,result = self.errors[exceptiontype] else: + log("Unhandled Exception with " + self.__apiname__ + ": " + str(exceptiontype)) response.status,result = 500,{"status":"Unknown error","code":500} return result @@ -81,7 +82,7 @@ class APIHandler: methodname = self.get_method(path,keys) method = self.methods[methodname] except: - log("Could not find a handler for method " + methodname + " in API " + self.__apiname__,module="debug") + log("Could not find a handler for method " + str(methodname) + " in API " + self.__apiname__,module="debug") log("Keys: " + str(keys),module="debug") raise InvalidMethodException() return method(path,keys) diff --git a/maloja/apis/native_v1.py b/maloja/apis/native_v1.py index 33357c4..0af6647 100644 --- a/maloja/apis/native_v1.py +++ b/maloja/apis/native_v1.py @@ -141,7 +141,6 @@ def get_performance_external(**keys): @api.get("top/artists") def get_top_artists_external(**keys): - print(uri_to_internal(keys)) _, k_time, k_internal, _, _ = uri_to_internal(keys) ckeys = {**k_time, **k_internal}