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

Fix PyAction OpmLog #4440

Merged
merged 3 commits into from
Jan 23, 2025
Merged

Fix PyAction OpmLog #4440

merged 3 commits into from
Jan 23, 2025

Conversation

lisajulia
Copy link
Contributor

@lisajulia lisajulia commented Jan 21, 2025

This PR fixes logging messages with the OpmLog from embedded Python code.
This used to work and then stopped working at some point, I've now added a test for this (07fb927) and made the test pass.

The issue was that the internal logger of the static class OpmLog was not set when OpmLog was called from embedded python code.
I have added a function setLogger to the OpmLog such that the Logger can be set using a python function on the python object OpmLog.

I'm happy to discuss other approaches to this!

@lisajulia lisajulia changed the title Fix/py action opm log Fix PyAction OpmLog Jan 21, 2025
@lisajulia
Copy link
Contributor Author

jenkins build this please

@lisajulia lisajulia force-pushed the fix/pyAction-OpmLog branch from 4b55ea1 to 0f0539c Compare January 22, 2025 11:40
@lisajulia
Copy link
Contributor Author

jenkins build this please

Copy link
Member

@bska bska left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume the Python parts here do what you need, so I've mostly looked at the C++ parts. It mostly looks good to me, with a couple of points that could use some clarification.

opm/common/OpmLog/OpmLog.hpp Outdated Show resolved Hide resolved
opm/common/OpmLog/OpmLog.cpp Outdated Show resolved Hide resolved
tests/parser/PYACTION.cpp Show resolved Hide resolved
python/cxx/log.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@hakonhagland hakonhagland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've now added a test for this (07fb927) and made the test pass.

@lisajulia Are you referring to #4441 ? Seems like the last jenkins build there failed?

@lisajulia lisajulia force-pushed the fix/pyAction-OpmLog branch from 0f0539c to b482f65 Compare January 23, 2025 06:46
@lisajulia lisajulia force-pushed the fix/pyAction-OpmLog branch from b482f65 to dbc2b4e Compare January 23, 2025 06:50
@lisajulia
Copy link
Contributor Author

I've now added a test for this (07fb927) and made the test pass.

@lisajulia Are you referring to #4441 ? Seems like the last jenkins build there failed?

Yes exactly :)

@lisajulia
Copy link
Contributor Author

jenkins build this please

@lisajulia lisajulia requested review from blattms and bska January 23, 2025 07:00
Copy link
Member

@bska bska left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the updates. The C++ parts here look okay now. Let's await Python parts review before merging.

@blattms blattms merged commit 77070d1 into OPM:master Jan 23, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants