Odoo Help

0

How to write to logger in an osv_memory function?

By
AJ Schrafel Paper Corp
on 7/2/13, 2:49 AM 713 views

I have created the following class with a function in it. When I call the function with a button nothing is written to the openerp log, either an error or what I want the function to write. What am i doing wrong?

class database_function(osv.osv_memory):
    _name = "database.function"
    _description = "Database Functions"
    _logger = logging.getLogger(__name__)
    _columns = {
    }

    _defaults = {
    }

    def action_button_database_sync(self, cr, uid, ids, context=None):
            _logger.warning("this is a warning")
            _logger.info("this is info")
        return res

database_function()
0
Thierry BOULOGNE
On 1/18/15, 11:49 PM

Hello,

Late answer for bookmark :-):
Could try :
self._logger.info("this is info")

For replacing some variable :

self._logger.info("this is info %s",variable)


 

 

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)

Stats

Asked: 7/2/13, 2:49 AM
Seen: 713 times
Last updated: 3/16/15, 8:10 AM