summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ogRest.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/ogRest.py b/src/ogRest.py
index 02d3d0c..69620e6 100644
--- a/src/ogRest.py
+++ b/src/ogRest.py
@@ -20,7 +20,6 @@ from logging.handlers import SysLogHandler
from src.restRequest import *
-LOGGER = logging.getLogger()
class ThreadState(Enum):
IDLE = 0
@@ -60,9 +59,9 @@ class restResponse():
return self.msg
if response in {ogResponses.OK, ogResponses.IN_PROGRESS}:
- LOGGER.debug(self.msg[:ogRest.LOG_LENGTH])
+ logging.debug(self.msg[:ogRest.LOG_LENGTH])
else:
- LOGGER.warn(self.msg[:ogRest.LOG_LENGTH])
+ logging.warn(self.msg[:ogRest.LOG_LENGTH])
self.msg += '\r\n'
@@ -281,14 +280,14 @@ class ogRest():
method = request.get_method()
URI = request.get_uri()
- LOGGER.debug('Incoming request: %s%s', method, URI[:ogRest.LOG_LENGTH])
+ logging.debug('Incoming request: %s%s', method, URI[:ogRest.LOG_LENGTH])
if (not "stop" in URI and
not "reboot" in URI and
not "poweroff" in URI and
not "probe" in URI):
if self.state == ThreadState.BUSY:
- LOGGER.warn('Request has been received '
+ logging.warn('Request has been received '
'while ogClient is busy')
response = restResponse(ogResponses.SERVICE_UNAVAILABLE)
client.send(response.get())
@@ -306,7 +305,7 @@ class ogRest():
elif "refresh" in URI:
self.process_refresh(client)
else:
- LOGGER.warn('Unsupported request: %s',
+ logging.warn('Unsupported request: %s',
{URI[:ogRest.LOG_LENGTH]})
response = restResponse(ogResponses.BAD_REQUEST)
client.send(response.get())
@@ -331,7 +330,7 @@ class ogRest():
elif ("image/create" in URI):
self.process_imagecreate(client, request)
else:
- LOGGER.warn('Unsupported request: %s',
+ logging.warn('Unsupported request: %s',
URI[:ogRest.LOG_LENGTH])
response = restResponse(ogResponses.BAD_REQUEST)
client.send(response.get())