Specifying log file location using .json runner #2699
-
Hello, Is there a way to specify where you want log files generated by a HELICS co-simulation to be stored? In particular, I am interested in setting this up using the .json runner and federate configuration files. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Looking at the code in "cli.py" in PyHELICS, it doesn't look like there's a way to configure the location of the logging file. BUT, I decided to add it as a feature since it seemed within my programming ability to achieve. I've added the feature in the "add_runner_logging_path" branch and have a PR in place now. To use it just add "logging_path" at the root of the JSON and specify the location of where you'd like the logging files (relative the runner.json) to land. The path has to already exist; that is, this feature won't make folders for you, you have to get them in place yourself. Here's an example of a modified runner for the "fundamental_default" example that puts the logs in a folder called "logs" that is at the same point in the file hierarchy as the runner.json:
|
Beta Was this translation helpful? Give feedback.
Looking at the code in "cli.py" in PyHELICS, it doesn't look like there's a way to configure the location of the logging file.
BUT, I decided to add it as a feature since it seemed within my programming ability to achieve. I've added the feature in the "add_runner_logging_path" branch and have a PR in place now.
To use it just add "logging_path" at the root of the JSON and specify the location of where you'd like the logging files (relative the runner.json) to land. The path has to already exist; that is, this feature won't make folders for you, you have to get them in place yourself.
Here's an example of a modified runner for the "fundamental_default" example that puts the logs in a fold…