diff options
| author | Andy Smith <github@anarkystic.com> | 2012-01-10 14:39:44 -0800 |
|---|---|---|
| committer | Andy Smith <github@anarkystic.com> | 2012-01-10 14:39:44 -0800 |
| commit | e3aff52138c7140effdd2b37bae9261acd45eb50 (patch) | |
| tree | b89ef005c189e3854e17eb4de0e4b97f62ea9169 | |
| parent | 69225f2d9dffd035f81a5df6618b22c34251c6d5 (diff) | |
| parent | d940dc40e6d8cdd688314203e9f12f2149380c19 (diff) | |
Merge pull request #10 from 4P/gettext
Gettext
| -rw-r--r-- | keystone/config.py | 9 | ||||
| -rw-r--r-- | keystone/logging.py | 3 |
2 files changed, 8 insertions, 4 deletions
diff --git a/keystone/config.py b/keystone/config.py index 5e6f909c..6e8e163f 100644 --- a/keystone/config.py +++ b/keystone/config.py @@ -1,3 +1,4 @@ +import gettext import logging import sys import os @@ -64,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: @@ -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') 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): |
