Nightfirecat / RealmEye-API

An easy way to access your character data via RealmEye.
MIT License
13 stars 7 forks source link

Improve log rotation mechanism #54

Open Nightfirecat opened 6 years ago

Nightfirecat commented 6 years ago

Rather than simply writing to realmeyeapi_<date>, the logger should rotate the log from realmeyeapi.log when instantiated; it should move the file based on its last write date.

Need to be mindful of cases such as opening realmeyeapi.log at 23:59:59, writing at 00:00:01 the next day, and having the log rotation detection move to the wrong date... Likely needs some leeway. Otherwise, maybe each log->write() command needs to do this check? Not sure how expensive it is to check.