Skip to content
Snippets Groups Projects
Commit 2a5ddad0 authored by Eliott Sammier's avatar Eliott Sammier
Browse files

Improved logging for export phase

parent e822d808
Branches
Tags
No related merge requests found
......@@ -61,7 +61,7 @@ def main():
file_path = parts[i]
file_content = parts[i + 1]
create_file(root, Path(file_path), file_content)
print(f"Found {len(parts)} parts => {(len(parts)-1)/2} files.")
log.info(f"Found {len(parts)} parts => {(len(parts)-1)/2} files.")
if __name__ == "__main__":
......
......@@ -12,19 +12,22 @@ from common import *
gateway_cmd = ["java", "-jar", MODULE_DIR + "/../corese-library-python-4.5.0.jar"]
log = get_logger("export_corese")
# Stop Java gateway when exiting script
def exit_handler(gateway):
if gateway is not None:
gateway.shutdown()
print("\nGateway server stopped.")
log.info("Gateway server stopped.")
else:
subprocess.run(["pkill", "--exact", "--full", " ".join(gateway_cmd)])
print("\nGateway server killed.")
log.warning("Gateway server killed.")
def apply_templates() -> str:
# Start Java gateway
log.info("Starting Corese gateway server...")
java_process = subprocess.Popen(gateway_cmd)
sleep(1)
gateway = JavaGateway()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment