pszymczyk / embedded-consul

Embedded Consul provides easy way to run Consul in integration tests.
Apache License 2.0
95 stars 29 forks source link

IllegalArgumentException: No enum constant com.pszymczyk.consul.LogLevel.ERROR #120

Open nolequen opened 2 years ago

nolequen commented 2 years ago

I'm getting the error when running embedded-consul 2.2.1 with latest Consul version (1.12.0) if Consul produces some errors.

[ERROR] embedded-consul - com.pszymczyk.consul.ConsulStarter: logging error: java.lang.IllegalArgumentException: No enum constant com.pszymczyk.consul.LogLevel.ERROR at java.base/java.lang.Enum.valueOf(Enum.java:273) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323) at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1491) at org.codehaus.groovy.runtime.callsite.StaticMetaClassSite.callStatic(StaticMetaClassSite.java:62) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:55) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:196) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:216) at com.pszymczyk.consul.LogLevel.valueOf(LogLevel.groovy) at com.pszymczyk.consul.LogLevel$valueOf.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:127) at com.pszymczyk.consul.ConsulLogHandler.parseConsulLog(ConsulLogHandler.groovy:41) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)

danielkwinsor commented 2 years ago

Same ConsulLogHandler is trying to do currentLevel = LogLevel.valueOf(levelToken) ?: LogLevel.INFO

TheDevOps commented 2 years ago

I created a minimal risk pull request just adding "error" in addition to not break older versions that still use "err"