Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separation of simulation results and errors #563

Closed
stanislav-git84 opened this issue Aug 19, 2024 · 9 comments · Fixed by #565 or #575
Closed

Separation of simulation results and errors #563

stanislav-git84 opened this issue Aug 19, 2024 · 9 comments · Fixed by #565 or #575
Labels
enhancement New feature or request fmusim

Comments

@stanislav-git84
Copy link

In FMI Compliance Checker, the separation of "Error logs" (-e) from Simulation Results (-o) was very handy. Also the possibility to select the "verbosity" of logging (I believe logging of errors) via (-l) was super useful.

It seems the warning/error logging is now also being added to fmusim #559 which I am very happy about.
Could you please also add an equivalent of the -l option for setting the "verbosity"?

@t-sommer t-sommer added enhancement New feature or request fmusim labels Aug 20, 2024
t-sommer added a commit to t-sommer/Reference-FMUs that referenced this issue Aug 20, 2024
@alexad19
Copy link

Hi @t-sommer,

I am wondering if you could also help us with the -e option (the redirecting of the fmi errors/warnings to a file). I believe this could be of great help for other developers as well.

Thank you!

@t-sommer
Copy link
Collaborator

I am wondering if you could also help us with the -e option (the redirecting of the fmi errors/warnings to a file).

Isn't this solved with #565?

@alexad19
Copy link

alexad19 commented Aug 20, 2024

Not really.
Resulting log.txt file with the running of the
fmusim.exe --log-fmi-calls --logging-on --log-level ok --fmi-log-file log.txt SimpleExample.fmu

image

Resulting log.txt file with the running of the
fmusim.exe --log-fmi-calls --logging-on --log-level warning --fmi-log-file log.txt SimpleExample.fmu

image

Resulting log.txt file with the running of the
fmusim.exe --log-fmi-calls --logging-on --log-level error --fmi-log-file log.txt SimpleExample.fmu

image

Please note that in all 3 cases the warning
[Warning] Debug hook active. Please attach your debugger!
was always sent via the callbackfunctions logger

@alexad19
Copy link

I might have misunderstood, but shouldn't the --fmi-log-file redirect the output to the file specified? It only seems to write the FMIok ones.

@t-sommer
Copy link
Collaborator

--log-level applies only to the messages issued by the FMU.

@stanislav-git84
Copy link
Author

What we wish for, and find really useful, is the possibility to re-direct the two "types" of information (aka. output that is per default being printed in the terminal) to two individual files. This was possible in FMI Compliance Checker by calling:
-e errors_warnings.txt -o results.csv
The newly added --log-level option is intendent of this output redirection; it shall apply to what is being printed no matter whether this is printed in the terminal or stored in a file.
Hope this makes our request somewhat clearer.

@t-sommer
Copy link
Collaborator

Why don't you just pipe the output to a file?

fmusim --output-file MyModel_out.csv MyModel.fmu > MyModel_log.txt

That way you also catch messages that are printed directly to the console bypassing the FMI API.

@stanislav-git84
Copy link
Author

Yes, this works but the separation is very much preferred option.
Rason being that by -e errors_warnings.txt -o results.csv we can check for any errors and warnings in the txt file (the same can be done in piped MyModel_log.txt indeed) separately from checking the actual simulation results stored in csv file. csv format is much better suited for checking values over time.

@stanislav-git84
Copy link
Author

Hello @t-sommer would you please consider our proposed feature for implementation?
For details, please see my previous comment: #563 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fmusim
Projects
None yet
3 participants