Skip to content

Commit

Permalink
Fix a bug when extracting the date from a log file name.
Browse files Browse the repository at this point in the history
  • Loading branch information
airxnoor committed Apr 11, 2024
1 parent 2d275c1 commit 736c8bd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
0.2.6 - April 11, 2024
• Fix a bug when extracting the date from a log file name.

0.2.5 - April 11, 2024
• Fix a bug when computing the log date from a file name.
• Expose `FileLoggerFacility.baseFolder` property to public use.
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

rootProject.group = "com.airthings.lib"
rootProject.version = "0.2.5"
rootProject.version = "0.2.6"

buildscript {
repositories {
Expand Down
2 changes: 1 addition & 1 deletion src/commonMain/kotlin/com/airthings/lib/logging/LogDate.kt
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ fun String.asLogDate(separator: Char?): LogDate? {
return null
}

val dateAsStringValue = dateAsIntValue.padded(expectedLength)
val dateAsStringValue = dateAsIntValue.padded(LogDate.LOG_FILE_LENGTH_WITHOUT_SEPARATOR)

val year = dateAsStringValue.substring(0, 4).toIntOrNull() ?: return null
val month = dateAsStringValue.substring(4, 6).toIntOrNull() ?: return null
Expand Down

0 comments on commit 736c8bd

Please sign in to comment.