Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
23989 Lượt xem

Hello !

I want to know how to write in odoo log file from python ?

Thank you !

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

So you want to write in to the log file from Python when something executes?

You can simply use the default logging module from Python for this, you only need to import logging in your Python file.
A detailed example can be found here: 
https://www.odoo.com/forum/help-1/question/how-print-a-debug-message-on-log-file-1037

A second way would be to use print statements to write to your stdout.
NOTE: you HAVE to start your server with the --debug parameter to show the debug logs though.

Ảnh đại diện
Huỷ bỏ
Tác giả

Thank you !!