From 49447c26a410fface3f77d78f980a8274f2a701e Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Mon, 21 Jan 2013 15:17:10 +0000 Subject: Sync latest cfg from oslo-incubator Changes include: c5984ba Move logging config options into the log module 7cf016a Fixing the trim for ListOp when reading from config file The most significant change is that cfg no longer provides logging config options as these have been moved to the log module which keystone does not yet use. Define these options in keystone.config where they are used since pulling in oslo logging isn't appropriate if we're not going to use it. Change-Id: I3913ea54465658d93dc56e014dfe5d911b0541d6 --- keystone/config.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'keystone/config.py') diff --git a/keystone/config.py b/keystone/config.py index c26a518c..34ab2b99 100644 --- a/keystone/config.py +++ b/keystone/config.py @@ -24,8 +24,46 @@ from keystone.openstack.common import cfg gettext.install('keystone', unicode=1) +_DEFAULT_LOG_FORMAT = "%(asctime)s %(levelname)8s [%(name)s] %(message)s" +_DEFAULT_LOG_DATE_FORMAT = "%Y-%m-%d %H:%M:%S" + +common_cli_opts = [ + cfg.BoolOpt('debug', + short='d', + default=False, + help='Print debugging output (set logging level to ' + 'DEBUG instead of default WARNING level).'), + cfg.BoolOpt('verbose', + short='v', + default=False, + help='Print more verbose output (set logging level to ' + 'INFO instead of default WARNING level).'), +] + +logging_cli_opts = [ + cfg.StrOpt('log-config', + metavar='PATH', + help='If this option is specified, the logging configuration ' + 'file specified is used and overrides any other logging ' + 'options specified. Please see the Python logging module ' + 'documentation for details on logging configuration ' + 'files.'), + cfg.StrOpt('log-date-format', + default=_DEFAULT_LOG_DATE_FORMAT, + metavar='DATE_FORMAT', + help='Format string for %%(asctime)s in log records. ' + 'Default: %(default)s'), + cfg.BoolOpt('use-syslog', + default=False, + help='Use syslog for logging.'), + cfg.StrOpt('syslog-log-facility', + default='LOG_USER', + help='syslog facility to receive log lines') +] CONF = cfg.CONF +CONF.register_cli_opts(common_cli_opts) +CONF.register_cli_opts(logging_cli_opts) def setup_logging(conf): -- cgit