Closed djbowers closed 7 years ago
I have verified that this works and multiple log files are created. There may be more work we want to do on it, like grouping all of the repeated code into a function, but this is a good place to start.
So, it looks like you could move
out = process.wait()
stdoutdata, stderrdata = process.communicate()
logger.info(stdoutdata)
logger.info(stderrdata)
into a function that takes process [and calls get_logger() itself] and returns the return code. That would remove a lot of the verbosity.
So I didn't put the call to get_logger() in the new function because the logger is used outside of that function as well (such as in line 370). Either way it doesn't save us an argument because we either have to pass logfile or logger to log_info(). Let me know if this makes sense.
+1, but let's run some CI to verify
+1
Instead of doing this, just remove the calls to
rotate_log
on lines 151 and 350.