Skip to content

Commit 8a6260f

Browse files
authored
#86 and #87 - fix exit method signature
* fixing signature of exit * resolve issue with type on exit. Ensure tests handle line feeds, flushing and loglevels consistently on Windows and Linux. * updated spacing and added .editorconfig * revert line length to styleguide * fix tests
1 parent 01c9a6d commit 8a6260f

File tree

11 files changed

+164
-300
lines changed

11 files changed

+164
-300
lines changed

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ indent_style = space
99
charset = utf-8
1010
indent_size = 4
1111

12+

src/commonMain/kotlin/mu/KLogger.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
package mu
22

3-
43
expect interface KLogger {
54

6-
75
/**
86
* Lazy add a log message if isTraceEnabled is true
97
*/
@@ -117,7 +115,7 @@ expect interface KLogger {
117115
/**
118116
* Add a log message with the return value of a method
119117
*/
120-
fun <T> exit(retval: T?): T? where T : Any
118+
fun <T> exit(retval: T): T where T : Any?
121119

122120
/**
123121
* Add a log message indicating an exception will be thrown along with the stack trace.

src/jsMain/kotlin/mu/KLogger.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
package mu
22

3-
43
actual interface KLogger {
54

6-
75
/**
86
* Lazy add a log message if isTraceEnabled is true
97
*/
@@ -117,7 +115,7 @@ actual interface KLogger {
117115
/**
118116
* Add a log message with the return value of a method
119117
*/
120-
actual fun <T> exit(retval: T?): T? where T : Any
118+
actual fun <T> exit(retval: T): T where T : Any?
121119

122120
/**
123121
* Add a log message indicating an exception will be thrown along with the stack trace.

src/jsMain/kotlin/mu/internal/KLoggerJS.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ internal class KLoggerJS(
9898
TRACE.logIfEnabled({ "exit()" }, APPENDER::trace)
9999
}
100100

101-
override fun <T : Any> exit(retval: T?): T? {
101+
override fun <T : Any?> exit(retval: T): T {
102102
TRACE.logIfEnabled({ "exit($retval)" }, APPENDER::trace)
103103
return retval
104104
}

src/jvmMain/kotlin/mu/KLogger.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ actual interface KLogger : Logger {
127127
/**
128128
* Add a log message with the return value of a method
129129
*/
130-
actual fun <T> exit(retval: T?): T? where T : Any
130+
actual fun <T> exit(retval: T): T where T : Any?
131131

132132
/**
133133
* Add a log message indicating an exception will be thrown along with the stack trace.

0 commit comments

Comments
 (0)