Python and Pydev debugger?

Edit:

Using Liclipse 1.2.1 instead of 1.3.0 or 1.4.0 works fine. The changelog lists Pydev 3.9.1 and Eclipse 4.4.1 updates for 1.3.0. It seems like you need to debug the debugging record.


Using the Liclipse and Pydev (and CPython) debugger with the following code example, getting this error:

logging.config.dictConfig(config) File "C:\Python27\lib\logging\config.py", line 794, in dictConfig dictConfigClass(config).configure() File "C:\Python27\lib\logging\config.py", line 576, in configure '%r: %s' % (name, e)) ValueError: Unable to configure handler 'console': 'DictConfigurator' object has no attribute 'startswith' 

There is no problem without debugging, should the logging module work in the runtime environment and will only work on it?

Here is an example of the code used:

 import logging.config import yaml def setup_logging(): default_path = 'logger.conf' default_level = logging.DEBUG if os.path.exists(default_path): with open(default_path, 'rt') as f: config = yaml.load(f.read()) logging.config.dictConfig(config) else: logging.basicConfig(level=default_level) 

And here is my logger.conf:

 version: 1 disable_existing_loggers: False formatters: simple: format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s" lineInfo: format: "%(asctime)s - Line: %(lineno)d - %(name)s - %(levelname)s - %(message)s" handlers: console: class: logging.StreamHandler level: DEBUG formatter: lineInfo stream: ext://sys.stdout debug_file_handler: class: logging.handlers.RotatingFileHandler level: DEBUG formatter: lineInfo filename: logs/debug.log maxBytes: 10485760 # 10MB backupCount: 10 encoding: utf8 info_file_handler: class: logging.handlers.RotatingFileHandler level: INFO formatter: simple filename: logs/info.log maxBytes: 10485760 # 10MB backupCount: 10 encoding: utf8 error_file_handler: class: logging.handlers.RotatingFileHandler level: ERROR formatter: simple filename: logs/errors.log maxBytes: 10485760 # 10MB backupCount: 10 encoding: utf8 root: level: DEBUG handlers: [console, info_file_handler, error_file_handler, debug_file_handler] 

thanks

+8
python debugging logging pycharm configuration
source share
3 answers

same problem with PyCharm. a possible workaround is to comment out the line pydev_monkey_qt.patch_qt () in pycharm / helpers / pydev / pydevd.py, for Eclipse it should be located somewhere else

+9
source share

There is currently a relatively obscure (because they do not include the OP error line on their web page for good search indexing) implemented in PyCharm for this: https://www.jetbrains.com/pycharm/help/python-debugger. html

In PyCharm, go to: File | Settings | Creation, Execution, Deployment | Python debugger

Then uncheck "PyQt Compatibility"

+8
source share

Ensure PyQt4 Import Prior to Log Import

+1
source share

All Articles