Added os env conrolled logging
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
import os
|
||||
|
||||
def resolveItem(action, item):
|
||||
resolver_log = os.environ.get("LOGS_RESOLVER", "false").lower() == "true"
|
||||
|
||||
resolved = {}
|
||||
if hasattr(action, "resolve"):
|
||||
for label, keys in action.resolve["get"].items():
|
||||
@@ -8,7 +12,8 @@ def resolveItem(action, item):
|
||||
target = target[key]
|
||||
|
||||
except (KeyError, IndexError) as error:
|
||||
print(f"Resolver target key/index {error} not found during {action.name}")
|
||||
if resolver_log:
|
||||
print(f"Resolver target key/index {error} not found during {action.name}")
|
||||
target = None
|
||||
|
||||
resolved[label] = target
|
||||
|
||||
Reference in New Issue
Block a user