From 6b081e3909cd09907e7328a73aef605e194f3d65 Mon Sep 17 00:00:00 2001 From: Jingwei Hao Date: Thu, 14 Oct 2021 13:40:18 -0700 Subject: [PATCH 1/2] Assign int to log levels Signed-off-by: Jingwei Hao --- .../kotlin/io/envoyproxy/envoymobile/LogLevel.kt | 16 ++++++++-------- library/swift/LogLevel.swift | 14 +++++++------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/library/kotlin/io/envoyproxy/envoymobile/LogLevel.kt b/library/kotlin/io/envoyproxy/envoymobile/LogLevel.kt index 7975c0cbcf..d4bc033977 100644 --- a/library/kotlin/io/envoyproxy/envoymobile/LogLevel.kt +++ b/library/kotlin/io/envoyproxy/envoymobile/LogLevel.kt @@ -3,12 +3,12 @@ package io.envoyproxy.envoymobile /** * Available logging levels for an Envoy instance. Note some levels may be compiled out. */ -enum class LogLevel(internal val level: String) { - TRACE("trace"), - DEBUG("debug"), - INFO("info"), - WARN("warn"), - ERROR("error"), - CRITICAL("critical"), - OFF("off"); +enum class LogLevel(internal val levelStr: String, val levelInt: Int) { + TRACE("trace", 0), + DEBUG("debug", 1), + INFO("info", 2), + WARN("warn", 3), + ERROR("error", 4), + CRITICAL("critical", 5), + OFF("off", -1); } diff --git a/library/swift/LogLevel.swift b/library/swift/LogLevel.swift index bff451fa6d..1f144f322d 100644 --- a/library/swift/LogLevel.swift +++ b/library/swift/LogLevel.swift @@ -4,13 +4,13 @@ import Foundation /// Note that some levels may be compiled out. @objc public enum LogLevel: Int { - case trace - case debug - case info - case warn - case error - case critical - case off + case trace = 0 + case debug = 1 + case info = 2 + case warn = 3 + case error = 4 + case critical = 5 + case off = -1 /// String representation of the log level. var stringValue: String { From a23cec1b45188551941e194fa8f6870a17f86dc1 Mon Sep 17 00:00:00 2001 From: Jingwei Hao Date: Thu, 14 Oct 2021 13:51:24 -0700 Subject: [PATCH 2/2] update Signed-off-by: Jingwei Hao --- library/kotlin/io/envoyproxy/envoymobile/LogLevel.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/kotlin/io/envoyproxy/envoymobile/LogLevel.kt b/library/kotlin/io/envoyproxy/envoymobile/LogLevel.kt index d4bc033977..6c7fb8ec19 100644 --- a/library/kotlin/io/envoyproxy/envoymobile/LogLevel.kt +++ b/library/kotlin/io/envoyproxy/envoymobile/LogLevel.kt @@ -3,7 +3,7 @@ package io.envoyproxy.envoymobile /** * Available logging levels for an Envoy instance. Note some levels may be compiled out. */ -enum class LogLevel(internal val levelStr: String, val levelInt: Int) { +enum class LogLevel(internal val level: String, val levelInt: Int) { TRACE("trace", 0), DEBUG("debug", 1), INFO("info", 2),