Logger filename fix#24
Conversation
This uses a date time formatter to fix a couple of issues, mainly that we were using zero-based months (leading to values of 1 for January, for example) and also not padding fields, leading to incorrect lexical sorting.
|
Code Climate has analyzed commit d186e00 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 66.6% (50% is the threshold). This pull request will bring the total coverage in the repository to 18.3% (0.6% change). View more on Code Climate. |
Codecov Report
@@ Coverage Diff @@
## master #24 +/- ##
============================================
+ Coverage 17.78% 18.37% +0.58%
- Complexity 17 18 +1
============================================
Files 13 13
Lines 371 370 -1
Branches 25 25
============================================
+ Hits 66 68 +2
+ Misses 305 302 -3
|
|
When I refactored the code last year, I didn't notice that months were zero-indexed unlike everything else. My fault. One thing that did get cut, though, was adding the op mode to the filename, as I had moved generation of the filename out of the robot file. It might be a good idea to readd that back in. (Maybe as an optional parameter?) |
I fixed the month index in the new logger system. |
I've noticed that the log filenames are kind of wonky, the months are zero-indexed and none of the fields are padded so lexicographical sorting isn't currently possible. This adds a utility method to generate log filenames based on a calendar entry, and uses it in the log filename generation, and also tests the new functionality.