We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi all,
To make levelname more pleasant, a user can override the default e.g. INFO and WARNING labels with something else, such as..
levelname
INFO
WARNING
import logging log = logging.getLogger("myLogger") fmt = logging.Formatter("%(levelname)s : %(message)s") handler = logging.StreamHandler() handler.setFormatter(fmt) log.addHandler(handler) log.propagate = False log.info("Hello!") # INFO : Hello! logging.addLevelName(logging.INFO, "Info") log.info("Hello!") # Info : Hello!
However, this breaks PyMEL. :(
# Error: root : Uncaught exception: Traceback (most recent call last): File "<maya console>", line 2, in <module> File "/opt/autodesk/maya-2019.2/lib/python2.7/site-packages/pymel/core/init.py", line 13, in <module> import pymel.internal.factories as _factories File "/opt/autodesk/maya-2019.2/lib/python2.7/site-packages/pymel/internal/factories.py", line 27, in <module> from . import apicache File "/opt/autodesk/maya-2019.2/lib/python2.7/site-packages/pymel/internal/apicache.py", line 13, in <module> from pymel.api.plugins import mpxNamesToApiEnumNames File "/opt/autodesk/maya-2019.2/lib/python2.7/site-packages/pymel/api/plugins.py", line 319, in <module> _logger.raiseLog(_logger.WARNING, 'found new MPx classes: %s. Run pymel.api.plugins._suggestNewMPxValues()' AttributeError: 'Logger' object has no attribute 'WARNING' # # Error: AttributeError: 'Logger' object has no attribute 'WARNING' #
Because of this here.
pymel/pymel/internal/plogging.py
Lines 216 to 219 in a2dc935
Would recommend explicitly storing the exact labels, since they are assumed elsewhere. For example..
logger.INFO = logging.INFO logger.WARNING = logging.WARNING logger.CRITICAL = logging.CRITICAL
Or better yet, use the original values to avoid confusion.
The text was updated successfully, but these errors were encountered:
Fix LumaPictures/pymel#438
9bdd1d0
No branches or pull requests
Hi all,
To make
levelname
more pleasant, a user can override the default e.g.INFO
andWARNING
labels with something else, such as..However, this breaks PyMEL. :(
Because of this here.
pymel/pymel/internal/plogging.py
Lines 216 to 219 in a2dc935
Would recommend explicitly storing the exact labels, since they are assumed elsewhere. For example..
Or better yet, use the original values to avoid confusion.
The text was updated successfully, but these errors were encountered: