~ubuntu-branches/ubuntu/raring/nova/raring-proposed

« back to all changes in this revision

Viewing changes to nova/openstack/common/log.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Adam Gandelman, Chuck Short
  • Date: 2012-11-23 09:04:58 UTC
  • mfrom: (1.1.66)
  • Revision ID: package-import@ubuntu.com-20121123090458-91565o7aev1i1h71
Tags: 2013.1~g1-0ubuntu1
[ Adam Gandelman ]
* debian/control: Ensure novaclient is upgraded with nova,
  require python-keystoneclient >= 1:2.9.0. (LP: #1073289)
* debian/patches/{ubuntu/*, rbd-security.patch}: Dropped, applied
  upstream.
* debian/control: Add python-testtools to Build-Depends.

[ Chuck Short ]
* New upstream version.
* Refreshed debian/patches/avoid_setuptools_git_dependency.patch.
* debian/rules: FTBFS if missing binaries.
* debian/nova-scheudler.install: Add missing rabbit-queues and
  nova-rpc-zmq-receiver.
* Remove nova-volume since it doesnt exist anymore, transition to cinder-*.
* debian/rules: install apport hook in the right place.
* debian/patches/ubuntu-show-tests.patch: Display test failures.
* debian/control: Add depends on genisoimage
* debian/control: Suggest guestmount.
* debian/control: Suggest websockify. (LP: #1076442)
* debian/nova.conf: Disable nova-volume service.
* debian/control: Depend on xen-system-* rather than the hypervisor.
* debian/control, debian/mans/nova-conductor.8, debian/nova-conductor.init,
  debian/nova-conductor.install, debian/nova-conductor.logrotate
  debian/nova-conductor.manpages, debian/nova-conductor.postrm
  debian/nova-conductor.upstart.in: Add nova-conductor service.
* debian/control: Add python-fixtures as a build deps.

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
                       '%(message)s',
55
55
               help='format string to use for log messages with context'),
56
56
    cfg.StrOpt('logging_default_format_string',
57
 
               default='%(asctime)s %(levelname)s %(name)s [-] %(instance)s'
58
 
                       '%(message)s',
 
57
               default='%(asctime)s %(process)d %(levelname)s %(name)s [-]'
 
58
                       ' %(instance)s%(message)s',
59
59
               help='format string to use for log messages without context'),
60
60
    cfg.StrOpt('logging_debug_format_suffix',
61
 
               default='from (pid=%(process)d) %(funcName)s '
62
 
                       '%(pathname)s:%(lineno)d',
 
61
               default='%(funcName)s %(pathname)s:%(lineno)d',
63
62
               help='data to append to log format when level is DEBUG'),
64
63
    cfg.StrOpt('logging_exception_prefix',
65
 
               default='%(asctime)s TRACE %(name)s %(instance)s',
 
64
               default='%(asctime)s %(process)d TRACE %(name)s %(instance)s',
66
65
               help='prefix each line of exception output with this format'),
67
66
    cfg.ListOpt('default_log_levels',
68
67
                default=[
77
76
    cfg.BoolOpt('publish_errors',
78
77
                default=False,
79
78
                help='publish error events'),
 
79
    cfg.BoolOpt('fatal_deprecations',
 
80
                default=False,
 
81
                help='make deprecations fatal'),
80
82
 
81
83
    # NOTE(mikal): there are two options here because sometimes we are handed
82
84
    # a full instance (and could include more information), and other times we
171
173
    def audit(self, msg, *args, **kwargs):
172
174
        self.log(logging.AUDIT, msg, *args, **kwargs)
173
175
 
 
176
    def deprecated(self, msg, *args, **kwargs):
 
177
        stdmsg = _("Deprecated Config: %s") % msg
 
178
        if CONF.fatal_deprecations:
 
179
            self.critical(stdmsg, *args, **kwargs)
 
180
            raise DeprecatedConfig(msg=stdmsg)
 
181
        else:
 
182
            self.warn(stdmsg, *args, **kwargs)
 
183
 
174
184
    def process(self, msg, kwargs):
175
185
        if 'extra' not in kwargs:
176
186
            kwargs['extra'] = {}
451
461
    def format(self, record):
452
462
        record.color = self.LEVEL_COLORS[record.levelno]
453
463
        return logging.StreamHandler.format(self, record)
 
464
 
 
465
 
 
466
class DeprecatedConfig(Exception):
 
467
    message = _("Fatal call to deprecated config: %(msg)s")
 
468
 
 
469
    def __init__(self, msg):
 
470
        super(Exception, self).__init__(self.message % dict(msg=msg))