@SuppressWarnings("deprecation")
    private static Level fromLogMessageLevel(LogProtocol.LogMessage.Level level) {
        switch (level) {
            case FATAL:
                return LogLevel.FATAL;
            case ERROR:
                return LogLevel.ERROR;
            case WARNING:
                return LogLevel.WARNING;
            case CONFIG:
                return LogLevel.CONFIG;
            case INFO:
                return LogLevel.INFO;
            case EVENT:
                return LogLevel.EVENT;
            case DEBUG:
                return LogLevel.DEBUG;
            case SPAM:
                return LogLevel.SPAM;
            case UNKNOWN:
            case UNRECOGNIZED:
            default:
                return LogLevel.UNKNOWN;
        }
    }
Utility class for serialization of log requests and responses.

@author bjorncs
logserver/src/main/java/ai/vespa/logserver/protocol/ProtobufSerialization.java