lbryio / lbrycrd

The blockchain that provides the digital content namespace for the LBRY protocol
https://lbry.com
MIT License
2.57k stars 178 forks source link

Implement basic log rotation (closes #211) #344

Closed gahag closed 5 years ago

gahag commented 5 years ago

As discussed in #211, this PR introduces the automatic moving of and existing log file to an .old file. This means logs are preserved for the last 2 executions, and also implies the -shrinkdebugfile is no longer useful, and thus removed.

Please tell me if there are any improvements to be made.

BrannonKing commented 5 years ago

How does the rename handle conflicts should an existing "old" file already exist?

gahag commented 5 years ago

The old file is always replaced if it exists. This is an important part for assuring you have the log from the last two executions, but no more.

gahag commented 5 years ago

@BrannonKing please tell me if there's anything to be improved on this.