Best way to remotely debug Odoo / Python in a docker container with Eclipse + Pydev?

Is there a better way to describe below

http://pydev.org/manual_adv_remote_debugger.html

Without unnecessary things

import sys; sys.path.append(r'path_to\pydev\plugins\org.python.pydev\pysrc') import pydevd 

without using a breakpoint with a mouse click and place it just like below the location of the source code

 pydevd.settrace('10.0.0.1') 

works well, but mouseclick for a breakpoint will be much better in our situation, since making the code more complicated.

Is there a better way to do the debugging work in python / Odoo ??

+6
source share
1 answer

I always use logging to debug my Odoo modules. add this to the beginning of your class

 import logging _logger = _logger = logging.getLogger(__name__) 

then when you want the values ​​to be logged in the Odoo log, you could use.

 _logger.error(yourvariableormessagehere) 

or

 _logger.warning(yourvariableormessagehere) 

Using the standard Ubuntu terminal will result in error messages and warnings due to this color. Honestly, I do not know about other OS terminals.

0
source

Source: https://habr.com/ru/post/981536/


All Articles