changeset 2027:88d5e42a66c3 beta

fixed logging issue on non-ascii repos
author Marcin Kuzminski <marcin@python-works.com>
date Thu, 23 Feb 2012 04:04:00 +0200
parents c6e288dcb4a2
children ef3114b01c7c
files rhodecode/lib/base.py
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/lib/base.py	Thu Feb 23 03:51:39 2012 +0200
+++ b/rhodecode/lib/base.py	Thu Feb 23 04:04:00 2012 +0200
@@ -15,7 +15,7 @@
 
 from rhodecode import __version__, BACKENDS
 
-from rhodecode.lib import str2bool
+from rhodecode.lib import str2bool, safe_unicode
 from rhodecode.lib.auth import AuthUser, get_container_username, authfunc,\
     HasPermissionAnyMiddleware
 from rhodecode.lib.utils import get_repo_slug, invalidate_cache
@@ -147,12 +147,14 @@
 
             session['rhodecode_user'] = self.rhodecode_user.get_cookie_store()
             session.save()
-            log.info('User: %s accessed %s' % (auth_user, 
-                                               environ.get('PATH_INFO')))
+            log.info('User: %s accessed %s' % (
+                auth_user, safe_unicode(environ.get('PATH_INFO')))
+            )
             return WSGIController.__call__(self, environ, start_response)
         finally:
-            log.info('Request to %s time: %.3fs' % (environ.get('PATH_INFO'),
-                                                    time.time() - start))
+            log.info('Request to %s time: %.3fs' % (
+                safe_unicode(environ.get('PATH_INFO')), time.time() - start)
+            )
             meta.Session.remove()