From bbbd3ebbab264e1baffcc2b26025caf2da6b76e2 Mon Sep 17 00:00:00 2001 From: Hagai Ovadia Date: Thu, 10 Sep 2020 12:34:23 +0300 Subject: [PATCH 1/4] fix logging --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7aa1d1d5..0d6f9f2e 100644 --- a/README.md +++ b/README.md @@ -139,3 +139,4 @@ Building the library from source is very straightforward. Simply run `sbt test`i ## License This code is licensed under the Apache V2.0 license, a copy of which is included [here](LICENSE.txt). + From 0df3e449c8196208f55275b0716fe54271155326 Mon Sep 17 00:00:00 2001 From: Hagai Ovadia Date: Thu, 10 Sep 2020 13:09:48 +0300 Subject: [PATCH 2/4] fix LoggingConfig --- client/src/main/scala/skuber/api/client/LoggingConfig.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/main/scala/skuber/api/client/LoggingConfig.scala b/client/src/main/scala/skuber/api/client/LoggingConfig.scala index c8860ede..93f0323a 100644 --- a/client/src/main/scala/skuber/api/client/LoggingConfig.scala +++ b/client/src/main/scala/skuber/api/client/LoggingConfig.scala @@ -22,7 +22,7 @@ case class LoggingConfig( object LoggingConfig { private def loggingEnabled(logEventType: String, fallback: Boolean) : Boolean= { - sysProps.get(s"skuber.log.$logEventType").map(_ => true).getOrElse(fallback) + sysProps.get(s"skuber.log.$logEventType").map(value => value.toBoolean).getOrElse(fallback) } } From 9321c093f03fc950f8ab7414773267a98a41f614 Mon Sep 17 00:00:00 2001 From: Hagai Ovadia Date: Thu, 10 Sep 2020 13:10:37 +0300 Subject: [PATCH 3/4] fix LoggingConfig --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0d6f9f2e..7aa1d1d5 100644 --- a/README.md +++ b/README.md @@ -139,4 +139,3 @@ Building the library from source is very straightforward. Simply run `sbt test`i ## License This code is licensed under the Apache V2.0 license, a copy of which is included [here](LICENSE.txt). - From 06cbc35116c2627ea3e83dcf7bbb5b5065d638d7 Mon Sep 17 00:00:00 2001 From: Hagai Ovadia Date: Thu, 10 Sep 2020 13:35:27 +0300 Subject: [PATCH 4/4] fix LoggingConfig --- .../src/main/scala/skuber/api/client/LoggingConfig.scala | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client/src/main/scala/skuber/api/client/LoggingConfig.scala b/client/src/main/scala/skuber/api/client/LoggingConfig.scala index 93f0323a..cd31ad0e 100644 --- a/client/src/main/scala/skuber/api/client/LoggingConfig.scala +++ b/client/src/main/scala/skuber/api/client/LoggingConfig.scala @@ -6,6 +6,7 @@ package skuber.api.client */ import LoggingConfig.loggingEnabled +import scala.util.{Failure, Success, Try} case class LoggingConfig( logConfiguration: Boolean=loggingEnabled("config", true), // outputs configuration on initialisation) @@ -22,7 +23,12 @@ case class LoggingConfig( object LoggingConfig { private def loggingEnabled(logEventType: String, fallback: Boolean) : Boolean= { - sysProps.get(s"skuber.log.$logEventType").map(value => value.toBoolean).getOrElse(fallback) + sysProps.get(s"skuber.log.$logEventType").map { + value => Try(value.toBoolean) match { + case Success(value) => value + case Failure(_) => throw new IllegalArgumentException(s"argument skuber.log.$logEventType:$value can't be parsed to boolean") + } + }.getOrElse(fallback) } }