From c5b82c236ae656868ba5f1aab4ba52e0cee9902a Mon Sep 17 00:00:00 2001 From: Darius Maitia Date: Fri, 13 Sep 2024 13:49:01 -0300 Subject: [PATCH] Improve tryInitLogFromEnv logic --- zenoh-kotlin/src/commonMain/kotlin/io/zenoh/Zenoh.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/Zenoh.kt b/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/Zenoh.kt index b9514574c..5aba0e9fc 100644 --- a/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/Zenoh.kt +++ b/zenoh-kotlin/src/commonMain/kotlin/io/zenoh/Zenoh.kt @@ -118,8 +118,11 @@ object Zenoh { * @see Logger */ fun tryInitLogFromEnv() { - ZenohLoad - Logger.start(System.getenv(LOG_ENV) ?: "") + val logEnv = System.getenv(LOG_ENV) + if (logEnv != null) { + ZenohLoad + Logger.start(logEnv) + } } /**