Skip to content

Commit 26bf5c0

Browse files
committed
scala: refactored to scala style
1 parent 23f296b commit 26bf5c0

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

RubyScript/src/org/knime/ext/jruby/LoggerOutputStream.scala

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,11 @@ class LoggerOutputStream(
2121
if (str.endsWith("\n")) {
2222
str = str.substring(0, str.length - 1)
2323
}
24-
if (str.length == 0) return
25-
if (level == NodeLogger.LEVEL.INFO) {
26-
logger.info(str)
27-
} else if (level == NodeLogger.LEVEL.WARN) {
28-
logger.warn(str)
29-
} else if (level == NodeLogger.LEVEL.ERROR) {
30-
logger.error(str)
31-
} else {
32-
logger.debug(str)
24+
if (!str.isEmpty()) level match {
25+
case NodeLogger.LEVEL.INFO => logger.info(str)
26+
case NodeLogger.LEVEL.WARN => logger.warn(str)
27+
case NodeLogger.LEVEL.ERROR => logger.error(str)
28+
case _ => logger.debug(str)
3329
}
3430
}
3531

0 commit comments

Comments
 (0)