Suppress WARNING messages

4 views
Skip to first unread message

project2501

unread,
Mar 3, 2017, 8:43:31 AM3/3/17
to ipopo-users
Hi,
  Is it considered an anti-pattern to have loaded the same bundle more than once? I see WARNING messages on the console.
If it is not an anti-pattern or there are no significant side effects, is there a way to suppress these messages?

thank you.

project2501

unread,
Mar 3, 2017, 8:44:11 AM3/3/17
to ipopo-users
For example:

WARNING:pelix.main:Already installed bundle: radiant.find.components.ml.topics

Thomas Calmant

unread,
Mar 3, 2017, 1:43:10 PM3/3/17
to ipopo...@googlegroups.com
Hi,

This is a legacy from the OSGi specification, as only one bundle with a given symbolic name (the module name in iPOPO) can be installed at a time.
This is due to the way OSGi and the Java class loaders work.

In Python, loading the same module a second doesn't do anything: it only returns the module in its current state (no reload, no redefinition of constants, ...)
iPOPO prints a warning as it could be an unexpected behaviour in the application. Early versions of iPOPO were even raising an exception.

Indeed, this level of this message could be lowered, either at information or debug level, to quiet down the framework: this is subject to debate with other users.

Cheers,
Thomas


--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "ipopo-users".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse ipopo-users+unsubscribe@googlegroups.com.
Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.

Darren G

unread,
Mar 3, 2017, 2:02:43 PM3/3/17
to ipopo...@googlegroups.com
Ok. Thanks for the explanation. So this message is being logged at the WARN logger level? And I can filter it out with simple logger config now? Or were you speculating that in the future it could be?

Thanks in advance.

Thomas Calmant

unread,
Mar 3, 2017, 3:54:47 PM3/3/17
to ipopo...@googlegroups.com
Yes, this is a message logged at warning level in the "pelix.framework" logger, here:
https://github.com/tcalmant/ipopo/blob/master/pelix/framework.py#L719

I see 3 solutions here:
- lower the log level (like debug)
- use a specific a logger which could de/activated with a framework option.
- use the Python's warnings module for this kind of problem.

Both options could be coded quite easily, maybe for monday or tuesday.

Cheers,
Thomas

project2501

unread,
Mar 9, 2017, 6:32:57 AM3/9/17
to ipopo-users
For anyone else visiting this thread, this solution worked for me.

logging.getLogger("pelix.main").setLevel(logging.CRITICAL)
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse ipopo-users...@googlegroups.com.

Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.

--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "ipopo-users".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse ipopo-users...@googlegroups.com.

Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.

--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "ipopo-users".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse ipopo-users...@googlegroups.com.

Thomas Calmant

unread,
Mar 9, 2017, 11:42:49 AM3/9/17
to ipopo...@googlegroups.com
Hi,

The log level of this warning has been lowered to DEBUG in commit 6323c49.

Cheers,
Thomas


Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse ipopo-users+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages