<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: log.proto

namespace OS\PB\LogConfig;

use UnexpectedValueException;

/**
 * Protobuf type <code>OS.PB.LogConfig.LogLevelType</code>
 */
class LogLevelType
{
    /**
     * Invalid
     *
     * Generated from protobuf enum <code>LogLevel_NoChange = 0;</code>
     */
    const LogLevel_NoChange = 0;
    /**
     * (Default) 
     *
     * Generated from protobuf enum <code>LogLevel_Error = 1;</code>
     */
    const LogLevel_Error = 1;
    /**
     * Generated from protobuf enum <code>LogLevel_Warning = 2;</code>
     */
    const LogLevel_Warning = 2;
    /**
     * Generated from protobuf enum <code>LogLevel_Info = 3;</code>
     */
    const LogLevel_Info = 3;
    /**
     * Generated from protobuf enum <code>LogLevel_Debug = 4;</code>
     */
    const LogLevel_Debug = 4;

    private static $valueToName = [
        self::LogLevel_NoChange => 'LogLevel_NoChange',
        self::LogLevel_Error => 'LogLevel_Error',
        self::LogLevel_Warning => 'LogLevel_Warning',
        self::LogLevel_Info => 'LogLevel_Info',
        self::LogLevel_Debug => 'LogLevel_Debug',
    ];

    public static function name($value)
    {
        if (!isset(self::$valueToName[$value])) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no name defined for value %s', __CLASS__, $value));
        }
        return self::$valueToName[$value];
    }


    public static function value($name)
    {
        $const = __CLASS__ . '::' . strtoupper($name);
        if (!defined($const)) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no value defined for name %s', __CLASS__, $name));
        }
        return constant($const);
    }
}

