Changeset View
Changeset View
Standalone View
Standalone View
swh/graph/webgraph.py
Show First 20 Lines • Show All 266 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
def do_step(step, conf): | def do_step(step, conf): | ||||
log_dir = Path(conf["out_dir"]) / "logs" | log_dir = Path(conf["out_dir"]) / "logs" | ||||
log_dir.mkdir(exist_ok=True) | log_dir.mkdir(exist_ok=True) | ||||
step_logger = logger.getChild(f"steps.{step.name.lower()}") | step_logger = logger.getChild(f"steps.{step.name.lower()}") | ||||
if not step_logger.isEnabledFor(logging.INFO): | |||||
# Ensure that at least INFO messages are sent, because it is the level we use | |||||
# for the stdout of Java processes. These processes can take a long time to | |||||
# run, and it would be very annoying to have to run them again just because | |||||
# they crashed with no log. | |||||
step_logger.setLevel(logging.INFO) | |||||
step_handler = logging.FileHandler( | step_handler = logging.FileHandler( | ||||
log_dir | log_dir | ||||
/ ( | / ( | ||||
f"{conf['graph_name']}" | f"{conf['graph_name']}" | ||||
f"-{int(datetime.now().timestamp() * 1000)}" | f"-{int(datetime.now().timestamp() * 1000)}" | ||||
f"-{str(step).lower()}.log" | f"-{str(step).lower()}.log" | ||||
) | ) | ||||
) | ) | ||||
▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines |