Comment 15 for bug 1897721

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote : Re: [Bug 1897721] Default handler for loggers

This should fix that issue:

https://bazaar.launchpad.net/~maddevelopers/mg5amcnlo/LTS_dev/revision/316

Cheers,

Olivier

> On 31 May 2021, at 16:44, Karolos Potamianos <email address hidden> wrote:
>
> Hello Olivier,
>
> I applied the patch to my gridpack (adding the 'bin' to the path) and it
> didn't work. I then re-rasied the exception and obtain the following
> trace:
>
> Traceback (most recent call last):
> File "madevent/bin/gridrun", line 82, in <module>
> logging.config.fileConfig(os.path.join(root_path, 'bin', 'internal', 'me5_logging.conf'))
> File "/cvmfs/atlas.cern.ch/repo/sw/software/21.6/sw/lcg/releases/LCG_88b/Python/2.7.13/x86_64-centos7-gcc62-opt/lib/python2.7/logging/config.py", line 77, in fileConfig
> formatters = _create_formatters(cp)
> File "/cvmfs/atlas.cern.ch/repo/sw/software/21.6/sw/lcg/releases/LCG_88b/Python/2.7.13/x86_64-centos7-gcc62-opt/lib/python2.7/logging/config.py", line 134, in _create_formatters
> c = _resolve(class_name)
> File "/cvmfs/atlas.cern.ch/repo/sw/software/21.6/sw/lcg/releases/LCG_88b/Python/2.7.13/x86_64-centos7-gcc62-opt/lib/python2.7/logging/config.py", line 101, in _resolve
> __import__(used)
> ImportError: No module named ColorFormatter
>
> I saw there is a class ColorFormatter in
> madgraph/interface/coloring_logging.py but for some reason it's not
> autmatically included.
>
> Is this something that you understand on your end, or does the patch
> need to be applied in other places (than gridrun) to work ?
>
> Cheers,
> Karolos
>
> --
> You received this bug notification because you are subscribed to
> MadGraph5_aMC@NLO.
> https://bugs.launchpad.net/bugs/1897721
>
> Title:
> Default handler for loggers
>
> Status in MadGraph5_aMC@NLO:
> Confirmed
>
> Bug description:
> For some newer gridpacks, when running people encounter this error:
>
> No handlers could be found for logger "madevent.cards"
>
> That seems to come from madevent/bin/internal/banner.py . We've
> confirmed that adding
>
> logging.basicConfig()
>
> before the first call to logging.getLogger solves the problem, and the
> Python manual indeed says that it's a good idea to configure the
> loggers appropriately before using them.
>
> Unfortunately, I've not found the magic trick -- it seems as though
> some users encounter this error and others do not, and I haven't
> identified a consistent issue for the ones that do encounter the
> error. The solution seems harmless enough, though, so I'd suggest
> adding such a configuration call somewhere in Madgraph (even in the
> top level scripts if you wish).
>
> Thanks,
> Zach
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/mg5amcnlo/+bug/1897721/+subscriptions