riptano / ccm

A script to easily create and destroy an Apache Cassandra cluster on localhost
Apache License 2.0
1.22k stars 303 forks source link

New Rotated CCM log generates too much trash #585

Closed djbowers closed 7 years ago

ptnapoleon commented 7 years ago

Instead of doing this, just remove the calls to rotate_log on lines 151 and 350.

djbowers commented 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.

ptnapoleon commented 7 years ago

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.

djbowers commented 7 years ago

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.

ptnapoleon commented 7 years ago

+1, but let's run some CI to verify

ptnapoleon commented 7 years ago

+1