Closed JonathonMisiewicz closed 2 years ago
I never really addressed the questions raised here. ~4 years ago at Georgia Tech optking was meant to be the first piece / dependency of psi4 that moved to python logging to easily synchronize output between psi4 and various components. You are correct that the irc progress file isn't really a log since we're erasing it. I have kept it as a log so that it can be redirected easily to psi4's log files and optking's log file as needed down the road.
The repetitive printing was finally fixed in the way too large #67 when the logging system was configured so that it could inherit from psi4's logger if psi4 calls optking. The logs are now created appropriately as child loggers and the ircprogress handler is only assigned to the irc's logger
I need to fix an IRC bug for my own research, and in doing so, I've come across a problem in the current
ircprogress.log
printing code. When running the IRC test case, theircprogress.log
file displays the expected output several times over, interspersed with brief fragments of other lines. See the example file. My testing shows there are two issues:Simply writing the
ircprogress.log
file each time would eliminate these issues. Is there a reason why we're using logging? I'm not familiar with the design principles/interfacing requirements of PyOptking. Logging is great when you want to filter whether the message gets written, but we always want theircprogress.log
file written. Additionally, logging assumes that you can print messages one-by-one. That isn't the case for us. We want to print a message, wait for a potentially expensive electronic computation to finish, and then replace the message we printed earlier. That is not what the logging module is for.