dg9vh / YSFReflector-Dashboard

Dashboard for YSFReflector (by G4KLX)
Creative Commons Zero v1.0 Universal
35 stars 37 forks source link

Cleaner reading of old logs #28

Closed dougwollison closed 4 years ago

dougwollison commented 4 years ago

This fixes issue #25, which an acquaintance just ran into this weekend.

While the issue was technically caused by log files being stored in the the same folder as the app itself, it's really because getOldYSFReflectorLog was reading any and all entries (including directories) in the designated folder, rather than just log files (as well as by it using different logic to identify lines than getYSFReflectorLog` uses).

This update makes the following changes:

This ensures that, regardless of where logs are stored, getOldYSFReflectorLog will return expected data (unless of course some other log files exist that have lines starting with M:).

This is arguably a bit of excessive idiot-proofing, but given how much of a pain it is to track down the cause from a DateTime parse error, it's probably worth it.