Odoo Help

Welcome!

This community 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.

0

How to write to logger in an osv_memory function?

By
AJ Schrafel Paper Corp
on 7/2/13, 2:49 AM 570 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)


 

 

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

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