From c3c05cbabd1f88fcef68ecb834f090f82955fd45 Mon Sep 17 00:00:00 2001 From: Joe Heck Date: Tue, 10 Jan 2012 14:22:41 -0800 Subject: adding gettext --- keystone/config.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/keystone/config.py b/keystone/config.py index 5e6f909c..5bb084c2 100644 --- a/keystone/config.py +++ b/keystone/config.py @@ -1,3 +1,4 @@ +import gettext import logging import sys import os @@ -83,6 +84,8 @@ def setup_logging(conf): root_logger.addHandler(handler) +gettext.install('keystone', unicode=1) + CONF = Config(project='keystone') register_str('admin_token', default='ADMIN') -- cgit From d940dc40e6d8cdd688314203e9f12f2149380c19 Mon Sep 17 00:00:00 2001 From: Joe Heck Date: Tue, 10 Jan 2012 14:33:15 -0800 Subject: fixing imports for syslog handlers and gettext --- keystone/config.py | 6 +++--- keystone/logging.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/keystone/config.py b/keystone/config.py index 5bb084c2..6e8e163f 100644 --- a/keystone/config.py +++ b/keystone/config.py @@ -65,13 +65,13 @@ def setup_logging(conf): if conf.use_syslog: try: - facility = getattr(logging.handlers.SysLogHandler, + facility = getattr(logging.SysLogHandler, conf.syslog_log_facility) except AttributeError: raise ValueError(_("Invalid syslog facility")) - handler = logging.handlers.SysLogHandler(address='/dev/log', - facility=facility) + handler = logging.SysLogHandler(address='/dev/log', + facility=facility) elif conf.log_file: logfile = conf.log_file if conf.log_dir: diff --git a/keystone/logging.py b/keystone/logging.py index d7cc6756..bac4e238 100644 --- a/keystone/logging.py +++ b/keystone/logging.py @@ -4,6 +4,7 @@ import functools import logging import pprint +from logging.handlers import SysLogHandler # A list of things we want to replicate from logging. # levels @@ -36,7 +37,7 @@ Formatter = logging.Formatter StreamHandler = logging.StreamHandler #WatchedFileHandler = logging.handlers.WatchedFileHandler # logging.SysLogHandler is nicer than logging.logging.handler.SysLogHandler. -#SysLogHandler = logging.handlers.SysLogHandler +SysLogHandler = SysLogHandler def log_debug(f): -- cgit