You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CWMS-Batch (the run env), cwms-python, and cwms-cli have made use of the logging that python offers.
Print does work to get stdout onto the page.
But I would consider agreeing on a repo-wide logging structure. When the time comes if cwms-cli, or other such libraries, were to use regi-python it would offer them the ability to control the log level. The idea that we would be running these in dev, test, and production environments. Where we might only want a critical log level for prod.
The idea that if a user or cwms-cli were to adopt these, they would be able to set the log level and regi-python would respect that.
Thoughts on changing print() to logging.info/etc and adding debug options?
Would like to discuss this on August 27th meeting.
I did swap the REGI Headless java logging to instead route through the python logging exactly for this case. It does a best attempt to translate python log levels to Java log levels to control debug, etc.
Activity
adamkorynta commentedon Aug 21, 2026
I did swap the REGI Headless java logging to instead route through the python logging exactly for this case. It does a best attempt to translate python log levels to Java log levels to control debug, etc.
See:
https://github.com/USACE-WaterManagement/regi-python/blob/main/regi-headless/src/main/python/regi_python/regi_python_logging.py
and
https://github.com/USACE-WaterManagement/regi-python/blob/main/regi-headless/src/main/java/usace/rowcps/headless/PythonJulHandler.java
krowvin commentedon Aug 21, 2026
Ah very good. In that case users adopting the example scripts might want to change their
printtologging.But we might also consider updating the examples themselves to the new log structure too.
Food for thought!