Added loging definitions and rich log handling. Operation and Recursive now define bypassed status based on completed count.
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
from rich.console import Console
|
||||||
|
|
||||||
|
console = Console(stderr=True)
|
||||||
@@ -1,14 +1,17 @@
|
|||||||
import logging
|
import logging
|
||||||
import pprint
|
import pprint
|
||||||
from rich.progress import track
|
from rich.progress import track
|
||||||
|
from rich.console import Console
|
||||||
|
|
||||||
from core.runtime.managefailure import manageFailure
|
from core.runtime.managefailure import manageFailure
|
||||||
from core.runtime.stopsignals import checkDependency
|
from core.runtime.stopsignals import checkDependency
|
||||||
from core.execution.processregistry import registerProcess
|
from core.execution.processregistry import registerProcess
|
||||||
|
from core.console import console
|
||||||
|
|
||||||
outputs = {}
|
outputs = {}
|
||||||
|
|
||||||
|
#console = Console(stderr=True)
|
||||||
|
|
||||||
def buildOperation(definition, outputs):
|
def buildOperation(definition, outputs):
|
||||||
process_log = True
|
process_log = True
|
||||||
|
|
||||||
@@ -22,7 +25,8 @@ def buildOperation(definition, outputs):
|
|||||||
actions = track(
|
actions = track(
|
||||||
actions,
|
actions,
|
||||||
#description=definition.name
|
#description=definition.name
|
||||||
description=f"[green]{definition.name}[/green]"
|
description=f"[green]{definition.name}[/green]",
|
||||||
|
console=console
|
||||||
)
|
)
|
||||||
|
|
||||||
for action in actions:
|
for action in actions:
|
||||||
@@ -57,6 +61,10 @@ def buildOperation(definition, outputs):
|
|||||||
|
|
||||||
#Print completion status after runtime processes
|
#Print completion status after runtime processes
|
||||||
if process_log:
|
if process_log:
|
||||||
|
#print(outputs["processes"][definition.name]["completed"])
|
||||||
|
if len(outputs["processes"][definition.name]["completed"]) == 1:
|
||||||
|
logging.info(f"{definition.name} bypassed")
|
||||||
|
else:
|
||||||
logging.info(f"{definition.name} completed")
|
logging.info(f"{definition.name} completed")
|
||||||
|
|
||||||
#For debugging purposes only
|
#For debugging purposes only
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import os
|
|||||||
from core.runtime.stopsignals import checkDependency
|
from core.runtime.stopsignals import checkDependency
|
||||||
from core.execution.processregistry import registerProcess
|
from core.execution.processregistry import registerProcess
|
||||||
from rich.progress import track
|
from rich.progress import track
|
||||||
|
from core.console import console
|
||||||
|
|
||||||
def buildRecursive(definition, outputs):
|
def buildRecursive(definition, outputs):
|
||||||
process_log = True
|
process_log = True
|
||||||
@@ -14,6 +15,8 @@ def buildRecursive(definition, outputs):
|
|||||||
source = outputs.get(definition.recursiveset["source"])
|
source = outputs.get(definition.recursiveset["source"])
|
||||||
|
|
||||||
if source is None or source == []:
|
if source is None or source == []:
|
||||||
|
if recursive_log:
|
||||||
|
logging.debug(f"No items available in {source} for {definition.name}")
|
||||||
return outputs, []
|
return outputs, []
|
||||||
|
|
||||||
outputs = registerProcess(definition, outputs)
|
outputs = registerProcess(definition, outputs)
|
||||||
@@ -25,15 +28,6 @@ def buildRecursive(definition, outputs):
|
|||||||
source = definition.recursiveset["source"]
|
source = definition.recursiveset["source"]
|
||||||
|
|
||||||
items = outputs.get(source)
|
items = outputs.get(source)
|
||||||
#print(f"RECURSIVE DEBUG DURING {definition.name}")
|
|
||||||
#print(items)
|
|
||||||
|
|
||||||
#if items is None:
|
|
||||||
|
|
||||||
# if recursive_log:
|
|
||||||
# print(f"No items available in {source} for {definition.name}")
|
|
||||||
#
|
|
||||||
# return outputs, None
|
|
||||||
|
|
||||||
reverse = definition.recursiveset.get("reverse", False)
|
reverse = definition.recursiveset.get("reverse", False)
|
||||||
|
|
||||||
@@ -43,7 +37,8 @@ def buildRecursive(definition, outputs):
|
|||||||
|
|
||||||
for item in track(
|
for item in track(
|
||||||
items,
|
items,
|
||||||
description=f"[green]{definition.name}[/green]"
|
description=f"[green]{definition.name}[/green]",
|
||||||
|
console=console
|
||||||
):
|
):
|
||||||
|
|
||||||
#for item in items:
|
#for item in items:
|
||||||
@@ -78,6 +73,10 @@ def buildRecursive(definition, outputs):
|
|||||||
outputs["processes"][definition.name]["completed"].append(job.alias)
|
outputs["processes"][definition.name]["completed"].append(job.alias)
|
||||||
|
|
||||||
if process_log:
|
if process_log:
|
||||||
|
#print(outputs["processes"][definition.name]["completed"])
|
||||||
|
if len(outputs["processes"][definition.name]["completed"]) == 1:
|
||||||
|
logging.info(f"{definition.name} bypassed")
|
||||||
|
else:
|
||||||
logging.info(f"{definition.name} completed")
|
logging.info(f"{definition.name} completed")
|
||||||
|
|
||||||
retain = definition.recursiveset.get("retain", True)
|
retain = definition.recursiveset.get("retain", True)
|
||||||
|
|||||||
+12
-1
@@ -7,10 +7,21 @@ from core.execution.createthread import buildThread
|
|||||||
from plugins.rmass.monitors import rmassmonitor
|
from plugins.rmass.monitors import rmassmonitor
|
||||||
from plugins.rmass.actions import refresh_tokens
|
from plugins.rmass.actions import refresh_tokens
|
||||||
|
|
||||||
|
from core.console import console
|
||||||
|
from rich.logging import RichHandler
|
||||||
|
|
||||||
logging.basicConfig(
|
logging.basicConfig(
|
||||||
level=logging.WARNING,
|
level=logging.WARNING,
|
||||||
format="%(levelname)s: %(message)s"
|
format="%(message)s",
|
||||||
|
handlers=[
|
||||||
|
RichHandler(
|
||||||
|
console=console,
|
||||||
|
show_time=False,
|
||||||
|
show_path=False
|
||||||
|
)
|
||||||
|
|
||||||
|
],
|
||||||
|
force=True
|
||||||
)
|
)
|
||||||
|
|
||||||
import login
|
import login
|
||||||
|
|||||||
Reference in New Issue
Block a user