~camptocamp/openobject-server/trunk-deprecate-osv_osv

« back to all changes in this revision

Viewing changes to openerp/tools/config.py

  • Committer: Alexandre Fayolle @ camptocamp
  • Date: 2012-09-18 06:58:00 UTC
  • Revision ID: alexandre.fayolle@camptocamp.com-20120918065800-o2vdib3gxfx15h0d
[IMP] control the display of DeprecationWarning from the command line

Show diffs side-by-side

added added

removed removed

Lines of Context:
184
184
        group.add_option('--log-response', action="append_const", dest="log_handler", const="openerp.netsvc.rpc.response:DEBUG", help='shortcut for --log-handler=openerp.netsvc.rpc.response:DEBUG')
185
185
        group.add_option('--log-web', action="append_const", dest="log_handler", const="openerp.addons.web.common.http:DEBUG", help='shortcut for --log-handler=openerp.addons.web.common.http:DEBUG')
186
186
        group.add_option('--log-sql', action="append_const", dest="log_handler", const="openerp.sql_db:DEBUG", help='shortcut for --log-handler=openerp.sql_db:DEBUG')
 
187
        group.add_option('--deprecation-warnings', metavar='<log|stderr|hide>',
 
188
                         default='log', dest="deprecation_warnings",
 
189
                         help="log deprecation warnings (default), print them on stderr, or hide them altogether")
187
190
        # For backward-compatibility, map the old log levels to something
188
191
        # quite close.
189
192
        levels = ['info', 'debug_rpc', 'warn', 'test', 'critical',
375
378
                'netrpc', 'xmlrpc', 'syslog', 'without_demo', 'timezone',
376
379
                'xmlrpcs_interface', 'xmlrpcs_port', 'xmlrpcs',
377
380
                'static_http_enable', 'static_http_document_root', 'static_http_url_prefix',
378
 
                'secure_cert_file', 'secure_pkey_file', 'dbfilter', 'log_handler', 'log_level'
 
381
                'secure_cert_file', 'secure_pkey_file', 'dbfilter', 'log_handler', 'log_level',
 
382
                'deprecation_warnings',
379
383
                ]
380
384
 
381
385
        for arg in keys: