تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
5380 أدوات العرض

When I run odoo with the option --log-sql (equivilant to handler=odoo.sql_db:DEBUG) it logs too many sql quires.

I only need to see one query which is called by a specific method. So setting the --log-sql option programmatically will be a nice way to do it.


I tried: 

 sql_logger = logging.getLogger('odoo.sql_db')

 sql_logger.setLevel('DEBUG')

res = Model.search(...)

sql_logger.setLevel('NOTSET')

But it doesn't give any logs unless i use time.sleep() after enable the log. It looks like it take sometime before enabling the log.


الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
ديسمبر 23
14171
0
أكتوبر 23
33
3
أكتوبر 23
788
1
أكتوبر 23
569
1
أغسطس 23
2126