4

I built a little GUI app with QtDesigner in Python and I passed the app along to a few people in my team which are using Autodesk 360 + Autocad.

My app use the QFileDialog command to get filenames, which is known to have a bug when Autodesk 360 is installed on the machine: link 1, link2 .

The bug: the console always returns the following errors when a file dialog is called:

log4cplus:ERROR No appenders could be found for logger (AdSyncNamespace).
log4cplus:ERROR Please initialize the log4cplus system properly.

The error is not critical as it doesn't change the processing, but I don't want any error message to pop like that.

Considering we will often distribute the app to people using Autodesk products daily and that the bug does not look like something that will be corrected soon, is it possible to ignore this error so that it does not show in the console ? Maybe by ignoring something during the build with py2exe... I don't know where to search. Thanks !

Community
  • 1
  • 1
kaycee
  • 901
  • 1
  • 9
  • 35
  • Do you use the console for any other input or output? – Tom Myddeltyn May 13 '16 at 19:09
  • Yes the console is used get some QA from the user during the process and to show some information logs – kaycee May 13 '16 at 19:12
  • 1
    You could put a handler on the stdout/stderr of the application and let everything pass through except certain messages. I don't know based on how the rest of your application is setup. – Tom Myddeltyn May 13 '16 at 19:14
  • Should I put the this handler in the main entry point of the app (i.e. the main.py script which is compiled by py2exe)? Do you have a code example for how I could filter this error ? – kaycee May 13 '16 at 19:18
  • http://forums.autodesk.com/t5/installation-hardware-os/log4cplus-error/td-p/4290303 – user3159253 May 13 '16 at 19:27
  • @user3159253, as it is written in the original message, I DONT want to uninstall Autodesk 360. I'm looking for an alternative solution.... – kaycee May 13 '16 at 19:29
  • Well, then you'll be the first who tracks the problem down to its root :) Feel brave, while I'm writing a longer comment. – user3159253 May 13 '16 at 19:32
  • @kaycee: Have you considered reporting this issue to Autodesk? – wilx May 14 '16 at 05:25

1 Answers1

5

Disclaimer: not a complete answer but an extended track of the problem.

The problem is that at least one of components of Autodesk 360, likely AdSyncNamespace.dll, uses log4cplus library but hasn't provided a correct configuration for it.

According to log4cplus:ERROR in python when calling for tkinter file dialog even @wilx , the author of log4cplus didn't know back in 2013, how to correctly fix the problem.

By default, log4cplus requires a java style property file to load configuration from, so I suppose, AdSyncNamespace.dll may have such a configuration, either in a file, or stored in a Windows registry key. You may search files containing log4cplus. strings in your Autodesk installation folder, and track what registry keys are accessed using See what files/registry keys are being accessed by application in Windows

Certainly, this all might seem quite boring and you might prefer a simpler solution. A simpler solution would be to redirect STDERR of your app to nowhere as described here or here but this might be not appropriate for your program since it uses console for output.

Update: you may try to set environment variable LOG4CPLUS_LOGLOG_QUIETMODE=false in your app or even globally, and check if it helps. Also if you don't need STDERR and perform all "valid" console output through STDOUT, then you may try to simply close STDERR or redirect it to nul as described in the links provided above.

Community
  • 1
  • 1
user3159253
  • 16,836
  • 3
  • 30
  • 56