Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assign an int to each log level #1885

Merged
merged 2 commits into from
Oct 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions library/kotlin/io/envoyproxy/envoymobile/LogLevel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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 level: 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);
}
14 changes: 7 additions & 7 deletions library/swift/LogLevel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down