From 81b667551826b14eb8ca6be2742732ed66c65a01 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 6 Sep 2017 11:15:40 +0200 Subject: [PATCH] Improved logging for network output --- plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py index ec1b0ac175..450f92a6e3 100755 --- a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py +++ b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py @@ -1099,8 +1099,11 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): global_container_stack.setMetaDataEntry("network_authentication_id", self._authentication_id) else: global_container_stack.addMetaDataEntry("network_authentication_id", self._authentication_id) - Application.getInstance().saveStack(global_container_stack) # Force save so we are sure the data is not lost. - Logger.log("i", "Authentication succeeded for id %s and key %s", self._authentication_id, self._getSafeAuthKey()) + Logger.log("i", "Authentication succeeded for id %s and key %s", self._authentication_id, self._getSafeAuthKey()) + Application.getInstance().saveStack(global_container_stack) # Force save so we are sure the data is not lost. + else: + Logger.log("w", "Unable to save authentication for id %s and key %s", self._authentication_id, self._getSafeAuthKey()) + else: # Got a response that we didn't expect, so something went wrong. Logger.log("e", "While trying to authenticate, we got an unexpected response: %s", reply.attribute(QNetworkRequest.HttpStatusCodeAttribute)) self.setAuthenticationState(AuthState.NotAuthenticated)