system.util.getLogger() and the .info() method

I just noticed in a customer log that calling the info() method, which doesn’t accept the parameter substitutions that the infof() method uses, delegates to the infof() method. Which means it blows up if the given string contains any substitution characters.
v7.9.1, fwiw. Is this a known bug?

Caused by: org.python.core.PyException: Traceback (most recent call last): File "", line 1, in File "", line 72, in checkInsert at java.util.Formatter.checkText(Unknown Source) at java.util.Formatter.parse(Unknown Source) at java.util.Formatter.format(Unknown Source) at java.util.Formatter.format(Unknown Source) at com.inductiveautomation.ignition.common.util.LoggerEx.createMessage(LoggerEx.java:200) at com.inductiveautomation.ignition.common.util.LoggerEx.infof(LoggerEx.java:279) at com.inductiveautomation.ignition.common.util.LoggerEx.info(LoggerEx.java:516) at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) java.util.UnknownFormatConversionException: java.util.UnknownFormatConversionException: Conversion = '\'
... 27 common frames omitted
Caused by: java.util.UnknownFormatConversionException: Conversion = '\'
at java.util.Formatter.checkText(Unknown Source)
at java.util.Formatter.parse(Unknown Source)
at java.util.Formatter.format(Unknown Source)
at java.util.Formatter.format(Unknown Source)
at com.inductiveautomation.ignition.common.util.LoggerEx.createMessage(LoggerEx.java:200)
at com.inductiveautomation.ignition.common.util.LoggerEx.infof(LoggerEx.java:279)
at com.inductiveautomation.ignition.common.util.LoggerEx.info(LoggerEx.java:516)
at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:186)
... 24 common frames omitted

Known and fixed in a more recent version

Thx. I expect to bump them to 7.9.6 after it settles in… (-:

1 Like

Just looked up the ticket, and it’s in 7.9.6 so you should be good when you upgrade. :slight_smile:

1 Like

BTW, is this true for debug() vs. debugf() and the other pairs?

Yup, and more characters to get to 20.

Hi there, I believe I am having the same issue but wanted to confirm. If this is the same issue, is there a release date planned for 7.9.6?

If this is not the same issue please let me know so I can troubleshoot further. I’d hate to wait for 7.9.6 and then find out it didn’t fix the issue.

Thanks!

Here is the error message:

Traceback (most recent call last):
File “event:propertyChange”, line 50, in
at java.util.Formatter.checkText(Unknown Source)
at java.util.Formatter.parse(Unknown Source)
at java.util.Formatter.format(Unknown Source)
at java.util.Formatter.format(Unknown Source)
at com.inductiveautomation.ignition.common.util.LoggerEx.createMessage(LoggerEx.java:194)
at com.inductiveautomation.ignition.common.util.LoggerEx.errorf(LoggerEx.java:313)
at com.inductiveautomation.ignition.common.util.LoggerEx.error(LoggerEx.java:469)
at sun.reflect.GeneratedMethodAccessor312.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)

java.util.UnknownFormatConversionException: java.util.UnknownFormatConversionException: Conversion = ‘/’

at org.python.core.Py.JavaError(Py.java:495)
at org.python.core.Py.JavaError(Py.java:488)
at org.python.core.PyReflectedFunction.call(PyReflectedFunction.java:188)
at org.python.core.PyReflectedFunction.call(PyReflectedFunction.java:204)
at org.python.core.PyObject.call(PyObject.java:404)
at org.python.core.PyObject.call(PyObject.java:408)
at org.python.core.PyMethod.call(PyMethod.java:124)
at org.python.pycode._pyx325.f$0(event:propertyChange:87)
at org.python.pycode._pyx325.call_function(event:propertyChange)
at org.python.core.PyTableCode.call(PyTableCode.java:165)
at org.python.core.PyCode.call(PyCode.java:18)
at org.python.core.Py.runCode(Py.java:1275)
at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(ScriptManager.java:634)
at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.runActions(ActionAdapter.java:180)
at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.access$000(ActionAdapter.java:40)
at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter$ActionRunner.run(ActionAdapter.java:286)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.util.UnknownFormatConversionException: Conversion = ‘/’
at java.util.Formatter.checkText(Unknown Source)
at java.util.Formatter.parse(Unknown Source)
at java.util.Formatter.format(Unknown Source)
at java.util.Formatter.format(Unknown Source)
at com.inductiveautomation.ignition.common.util.LoggerEx.createMessage(LoggerEx.java:194)
at com.inductiveautomation.ignition.common.util.LoggerEx.errorf(LoggerEx.java:313)
at com.inductiveautomation.ignition.common.util.LoggerEx.error(LoggerEx.java:469)
at sun.reflect.GeneratedMethodAccessor312.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.python.core.PyReflectedFunction.call(PyReflectedFunction.java:186)
… 27 more

Ignition v7.9.5 (b2017111615)
Java: Oracle Corporation 1.8.0_144

The workaround is to switch to .infof(), with a "%s" argument ahead of the string you tried to log with .info().

Thanks for the tip, but I think I am still missing something.

This is what I had before:
logger.info(url)

This is what I changed it to:
logger.infof("%s" %url)

But I am still getting the same error:
java.util.UnknownFormatConversionException: Conversion = ‘O’

use

logger.infof("%s", url)

Ah perfect, thank you, it is working now.

I am still planning to wait for 7.9.6 since this is used throughout our application. It doesn’t make sense to me to go through and implement the work around, but I am glad to confirm it is the same issue. Any update on a 7.9.6 timeline would be appreciated :slight_smile:

1 Like

The release candidate has been out for a while at https://inductiveautomation.com/downloads/beta, so you can download that and check that it solves your issue. Final should be very soon.

1 Like