Search code examples
pythonpython-3.xloggingprintingodoo

How to log warning, error and other info in Odoo development?


Question: I want to log the warning in odoo logs if any warning or error comes up.

Is there any way out of it?

Thanks in advance.


Solution

  • Please user logger to print the logs in terminal

    Try

    import logging

    logger = logging.getLogger(__name__)

    Use like this:-

    _logger.debug(" my log in terminal")