Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
10441 Vues

HI every one in odoo-7 development, i can see print statement output in console. How can i run odoo-8 server to  see print output in console?. If not can any one suggest me  a funciont like _logger.exception() in odoo-7 to debug my code in odoo-8,  while developing module?

Avatar
Ignorer

I think you are simply looking for the --log-level=debug when running your Odoo from terminal? This will print out all the statements in your Ubuntu terminal.

How can i start the odoo-8 server with the --log-level.. I tried but failed..

On Tue, Jan 6, 2015 at 8:04 PM, Yenthe <yenthespam@gmail.com> wrote:

I think you are simply looking for the --log-level=debug when running your Odoo from terminal? This will print out all the statements in your Ubuntu terminal.

--
Yenthe
Sent by Odoo S.A. using Odoo about Forum Post Funtion to print log message in the logfile odoo-8?



--
--

Thanks and Regards,

Sambasiva rao,

Skype: samba.guduru2(skype)

Simply open up your Ubuntu terminal and navigate to odoo/odoo-server (or however you named the structure). Then start your server with ./openerp-server --log-level=debug

Thank you Dinesh, I did these changes how  can i run server now?. sudo /etc/init.d/odoo-server start. When i type this there was no log generated in console

On Wed, Jan 7, 2015 at 11:52 AM, Dhinesh <dvdhinesh.mail@gmail.com> wrote:

A new answer for Funtion to print log message in the logfile odoo-8? has been posted. Click here to access the post.

--
Dhinesh



--
--

Thanks and Regards,

Sambasiva rao,

Skype: samba.guduru2(skype)

If you start odoo using init.d boot script, it will start as daemon process. There will be no console to print. Everything will be printed in log file specified in your configuration. Start your server like @Yenthe said, ./openerp-server --log-level=debug (Only for development purpose). You will get the message in print statement. You can also use import pdb;pdb.set_trace() in your module to debug it instead of usual print statement.

Meilleure réponse

Hi, This will work depends on your log level in your configuration file.
import logging
_logger = logging.getLogger(__name__)
_logger.error('msg')
_logger.warning('msg')
_logger.debug('msg')
_logger.info('msg')
_logger.exception('Connection to the database failed''msg')

Log parameters for configuration file:
# file where the server log will be stored
logfile = None
# specify the level of the logging. Accepted values: info, debug_rpc, warn, test, critical, debug_sql, error, debug, debug_rpc_answer, notset
log_level = info
log_handler = [':INFO']

You can also give these parameters from terminal while starting your sever.

Avatar
Ignorer