diff kallithea/lib/middleware/simplegit.py @ 5375:0210d0b769d4

cleanup: pass log strings unformatted - avoid unnecessary % formatting when not logging
author Mads Kiilerich <madski@unity3d.com>
date Sun, 09 Aug 2015 02:29:46 +0200
parents d69aa464f373
children d9386a3924db
line wrap: on
line diff
--- a/kallithea/lib/middleware/simplegit.py	Sun Aug 09 02:17:14 2015 +0200
+++ b/kallithea/lib/middleware/simplegit.py	Sun Aug 09 02:29:46 2015 +0200
@@ -55,8 +55,8 @@
 def is_git(environ):
     path_info = environ['PATH_INFO']
     isgit_path = GIT_PROTO_PAT.match(path_info)
-    log.debug('pathinfo: %s detected as Git %s' % (
-        path_info, isgit_path is not None)
+    log.debug('pathinfo: %s detected as Git %s',
+        path_info, isgit_path is not None
     )
     return isgit_path
 
@@ -80,7 +80,7 @@
         #======================================================================
         try:
             repo_name = self.__get_repository(environ)
-            log.debug('Extracted repo name is %s' % repo_name)
+            log.debug('Extracted repo name is %s', repo_name)
         except Exception:
             return HTTPInternalServerError()(environ, start_response)
 
@@ -126,7 +126,7 @@
                 pre_auth = auth_modules.authenticate('', '', environ)
                 if pre_auth is not None and pre_auth.get('username'):
                     username = pre_auth['username']
-                log.debug('PRE-AUTH got %s as username' % username)
+                log.debug('PRE-AUTH got %s as username', username)
 
                 # If not authenticated by the container, running basic auth
                 if not username:
@@ -178,7 +178,7 @@
         #===================================================================
         str_repo_name = safe_str(repo_name)
         repo_path = os.path.join(safe_str(self.basepath),str_repo_name)
-        log.debug('Repository path is %s' % repo_path)
+        log.debug('Repository path is %s', repo_path)
 
         # CHECK LOCKING only if it's not ANONYMOUS USER
         if username != User.DEFAULT_USER:
@@ -194,19 +194,19 @@
                            'locked_by': locked_by})
 
         fix_PATH()
-        log.debug('HOOKS extras is %s' % extras)
+        log.debug('HOOKS extras is %s', extras)
         baseui = make_ui('db')
         self.__inject_extras(repo_path, baseui, extras)
 
         try:
             self._handle_githooks(repo_name, action, baseui, environ)
-            log.info('%s action on Git repo "%s" by "%s" from %s' %
-                     (action, str_repo_name, safe_str(username), ip_addr))
+            log.info('%s action on Git repo "%s" by "%s" from %s',
+                     action, str_repo_name, safe_str(username), ip_addr)
             app = self.__make_app(repo_name, repo_path, extras)
             return app(environ, start_response)
         except HTTPLockedRC as e:
             _code = CONFIG.get('lock_ret_code')
-            log.debug('Repository LOCKED ret code %s!' % (_code))
+            log.debug('Repository LOCKED ret code %s!', _code)
             return e(environ, start_response)
         except Exception:
             log.error(traceback.format_exc())