When executing a command (wp-cypress start for example), fs.createWriteStream() would overwrite the debug.log file and start afresh causing all previous output to be lost. While not inherently a problem locally, the problem starts to really show when running in CI environments where you may have multiple commands running. Due to the debug.log being overwritten, we would need to capture the output between each command - sometimes that's not always possible. So appending that output becomes the better option. I believe the debug should persist for as long as required or possible without being overwritten.
Change Log
Add append (a) flag to write stream.
Change close event to only write on error.
Types of changes (if applicable):
[x] Bug fix (non-breaking change which fixes an issue).
[ ] New feature (non-breaking change which adds functionality).
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected).
Description
When executing a command (
wp-cypress start
for example),fs.createWriteStream()
would overwrite thedebug.log
file and start afresh causing all previous output to be lost. While not inherently a problem locally, the problem starts to really show when running in CI environments where you may have multiple commands running. Due to thedebug.log
being overwritten, we would need to capture the output between each command - sometimes that's not always possible. So appending that output becomes the better option. I believe the debug should persist for as long as required or possible without being overwritten.Change Log
a
) flag to write stream.Types of changes (if applicable):
Checklist (if applicable):