Skip to content

Commit cf74536

Browse files
committed
improve log interface API
1 parent 4a9d2ca commit cf74536

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/commonMain/kotlin/com/github/doyaaaaaken/kotlincsv/client/CsvFileReader.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class CsvFileReader internal constructor(
5252
@Suppress("DEPRECATION")
5353
if (row.size > numFieldsInRow) {
5454
if (ctx.excessFieldsRowBehaviour == ExcessFieldsRowBehaviour.TRIM) {
55-
logger.info { "trimming excess rows. [csv row num = ${idx + 1}, fields num = ${row.size}, fields num of row = $numFieldsInRow]" }
55+
logger.info("trimming excess rows. [csv row num = ${idx + 1}, fields num = ${row.size}, fields num of row = $numFieldsInRow]")
5656
row.subList(0, numFieldsInRow)
5757
} else if (ctx.skipMissMatchedRow || ctx.excessFieldsRowBehaviour == ExcessFieldsRowBehaviour.IGNORE) {
5858
skipMismatchedRow(idx, row, numFieldsInRow)
@@ -76,7 +76,7 @@ class CsvFileReader internal constructor(
7676
row: List<String>,
7777
numFieldsInRow: Int
7878
): Nothing? {
79-
logger.info { "skip miss matched row. [csv row num = ${idx + 1}, fields num = ${row.size}, fields num of first row = $numFieldsInRow]" }
79+
logger.info("skip miss matched row. [csv row num = ${idx + 1}, fields num = ${row.size}, fields num of first row = $numFieldsInRow]")
8080
return null
8181
}
8282

src/commonMain/kotlin/com/github/doyaaaaaken/kotlincsv/util/logger/Logger.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ package com.github.doyaaaaaken.kotlincsv.util.logger
66
* @see [com.github.doyaaaaaken.kotlincsv.dsl.context.ICsvReaderContext.logger]
77
*/
88
interface Logger {
9-
fun info(message: () -> Any?)
9+
fun info(message: String)
1010
}

src/commonMain/kotlin/com/github/doyaaaaaken/kotlincsv/util/logger/LoggerNop.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ package com.github.doyaaaaaken.kotlincsv.util.logger
44
* Internal no-operation logger implementation, which does not log anything.
55
*/
66
internal object LoggerNop : Logger {
7-
override fun info(message: () -> Any?) = Unit
7+
override fun info(message: String) = Unit
88
}

0 commit comments

Comments
 (0)