// Copyright 2018 Bull S.A.S. Atos Technologies - Bull, Rue Jean Jaures, B.P.68, 78340, Les Clayes-sous-Bois, France. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Code generated by go-enum // DO NOT EDIT! package events import ( "fmt" ) const ( // LogLevelINFO is a LogLevel of type INFO LogLevelINFO LogLevel = iota // LogLevelDEBUG is a LogLevel of type DEBUG LogLevelDEBUG // LogLevelWARN is a LogLevel of type WARN LogLevelWARN // LogLevelERROR is a LogLevel of type ERROR LogLevelERROR ) const _LogLevelName = "INFODEBUGWARNERROR" var _LogLevelMap = map[LogLevel]string{ 0: _LogLevelName[0:4], 1: _LogLevelName[4:9], 2: _LogLevelName[9:13], 3: _LogLevelName[13:18], } func (i LogLevel) String() string { if str, ok := _LogLevelMap[i]; ok { return str } return fmt.Sprintf("LogLevel(%d)", i) } var _LogLevelValue = map[string]LogLevel{ _LogLevelName[0:4]: 0, _LogLevelName[4:9]: 1, _LogLevelName[9:13]: 2, _LogLevelName[13:18]: 3, } // ParseLogLevel attempts to convert a string to a LogLevel func ParseLogLevel(name string) (LogLevel, error) { if x, ok := _LogLevelValue[name]; ok { return LogLevel(x), nil } return LogLevel(0), fmt.Errorf("%s is not a valid LogLevel", name) }