Improved logs and module level housekeeping
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
import logging
|
||||
|
||||
from core.apirequest import executeRequest
|
||||
from core.runtime.runtimecontract import buildRuntimeAttr, buildPreRuntimeAttr
|
||||
from core.runtime.stopsignals import addStopSignal
|
||||
#from core.runtime.stopsignals import addStopSignal
|
||||
|
||||
|
||||
def buildAction (action, outputs, process):
|
||||
action_log = True
|
||||
|
||||
outputs, resolved, match, filter = buildPreRuntimeAttr(action, outputs, process)
|
||||
|
||||
@@ -20,6 +23,9 @@ def buildAction (action, outputs, process):
|
||||
return outputs, None
|
||||
|
||||
#outputs["processes"][process.name][action.name]["response"] = response
|
||||
outputs, response = buildRuntimeAttr(action, outputs, resolved, response)
|
||||
outputs, response = buildRuntimeAttr(action, outputs, resolved, response, process)
|
||||
|
||||
if action_log:
|
||||
logging.info(f"{action.name} completed")
|
||||
|
||||
return outputs, response
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import logging
|
||||
import os
|
||||
|
||||
def buildLog (action, outputs, response):
|
||||
if hasattr(action, "prints"):
|
||||
@@ -12,7 +13,7 @@ def buildLog (action, outputs, response):
|
||||
except (KeyError, TypeError):
|
||||
pass
|
||||
|
||||
response_log = False
|
||||
response_log = os.environ.get("LOGS_SUCCESS_RESPONSE", "false").lower() == "true"
|
||||
|
||||
if action.showstatus is True and response.ok:
|
||||
if response_log:
|
||||
|
||||
@@ -17,7 +17,7 @@ port = int(os.environ.get("SERVER_PORT", 19001))
|
||||
|
||||
class RequestHandler(BaseHTTPRequestHandler):
|
||||
def do_POST(self):
|
||||
lifecycles = {}
|
||||
#lifecycles = {}
|
||||
print("POST request received")
|
||||
|
||||
max_request_size = 1024
|
||||
@@ -97,7 +97,7 @@ class RequestHandler(BaseHTTPRequestHandler):
|
||||
|
||||
|
||||
def do_PUT(self):
|
||||
print("PUT request received")
|
||||
#print("PUT request received")
|
||||
|
||||
outputs = buildListener(synapselistener, self)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user