diff MoinMoin/auth/__init__.py @ 6075:3f7f4cef7c2a

make log_attempt output easily parsed
author 'Karl O. Pinc' <kop@meme.com>
date Mon, 15 Sep 2014 21:53:09 -0500
parents a9567770da68
children 35473fe0967d
line wrap: on
line diff
--- a/MoinMoin/auth/__init__.py	Mon Sep 15 21:27:54 2014 -0500
+++ b/MoinMoin/auth/__init__.py	Mon Sep 15 21:53:09 2014 -0500
@@ -252,11 +252,11 @@
         u = user.User(request, name=username, password=password, auth_method=self.name)
         if u.valid:
             logging.debug("%s: successfully authenticated user %r (valid)" % (self.name, u.name))
-            log_attempt("auth: login (moin)", True, request, username)
+            log_attempt("auth/login (moin)", True, request, username)
             return ContinueLogin(u)
         else:
             logging.debug("%s: could not authenticate user %r (not valid)" % (self.name, username))
-            log_attempt("auth: login (moin)", False, request, username)
+            log_attempt("auth/login (moin)", False, request, username)
             return ContinueLogin(user_obj, _("Invalid username or password."))
 
     def login_hint(self, request):
@@ -379,12 +379,12 @@
             u.create_or_update()
         if u and u.valid:
             logging.debug("returning valid user %r" % u)
-            log_attempt("auth: request (given)", True, request, auth_username)
+            log_attempt("auth/request (given)", True, request, auth_username)
             return u, True # True to get other methods called, too
         else:
             logging.debug("returning %r" % user_obj)
             if u and not u.valid:
-                log_attempt("auth: request (given)", False, request, auth_username)
+                log_attempt("auth/request (given)", False, request, auth_username)
             return user_obj, True
 
 
@@ -474,7 +474,7 @@
         uid = request.session['setuid']
         userobj = user.User(request, uid, auth_method='setuid')
         userobj.valid = True
-        log_attempt("auth: login (setuid from %r)" % old_user.name,
+        log_attempt("auth/login (setuid from %r)" % old_user.name,
                     True, request, userobj.name)
     logging.debug("setup_suid returns %r, %r" % (userobj, old_user))
     return (userobj, old_user)