MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373170 )

Change subject: Log the heck out of everything
......................................................................

Log the heck out of everything

Bug: T173888
Change-Id: I6cd0a8f953fd823d33bba60df3b9dcfe51d4b4a3
---
M includes/LoginNotify.php
1 file changed, 38 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LoginNotify 
refs/changes/70/373170/1

diff --git a/includes/LoginNotify.php b/includes/LoginNotify.php
index 91a1938..df8217a 100644
--- a/includes/LoginNotify.php
+++ b/includes/LoginNotify.php
@@ -134,11 +134,16 @@
         */
        private function isKnownSystemFast( User $user, WebRequest $request ) {
                $result = $this->userIsInCookie( $user, $request );
-               if ( $result === self::USER_KNOWN ) {
-                       return $result;
+
+               if ( $result !== self::USER_KNOWN ) {
+                       $result = $this->mergeResults( $result, 
$this->userIsInCache( $user, $request ) );
                }
 
-               $result = $this->mergeResults( $result, $this->userIsInCache( 
$user, $request ) );
+               $this->log->debug( 'Checking cookies and cache for {user}: 
{result}', [
+                       'function' => __METHOD__,
+                       'user' => $user->getName(),
+                       'result' => $result,
+               ] );
 
                return $result;
        }
@@ -408,6 +413,13 @@
        public function setCurrentAddressAsKnown( User $user ) {
                $this->cacheLoginIP( $user );
                $this->setLoginCookie( $user );
+
+               $this->log->debug( 'Recording user {user} as known',
+                       [
+                               'function' => __METHOD__,
+                               'user' => $user->getName(),
+                       ]
+               );
        }
 
        /**
@@ -456,10 +468,13 @@
 
                // FIXME, does this really make sense?
                if ( $cookie === '' ) {
-                       return self::USER_NO_INFO;
+                       $result = self::USER_NO_INFO;
+               } else {
+                       list( $userKnown, ) = $this->checkAndGenerateCookie( 
$user, $cookie );
+                       $result = $userKnown ? self::USER_KNOWN : 
self::USER_NOT_KNOWN;
                }
-               list( $userKnown, ) = $this->checkAndGenerateCookie( $user, 
$cookie );
-               return $userKnown ? self::USER_KNOWN : self::USER_NOT_KNOWN;
+
+               return $result;
        }
 
        /**
@@ -665,6 +680,14 @@
                        'extra' => $extra,
                        'agent' => $user,
                ] );
+
+               $this->log->info( 'Sending a {type} notification to {user}',
+                       [
+                               'function' => __METHOD__,
+                               'type' => $type,
+                               'user' => $user->getName(),
+                       ]
+               );
        }
 
        /**
@@ -788,6 +811,15 @@
                        ]
                );
                JobQueueGroup::singleton()->lazyPush( $job );
+
+               $this->log->debug( 'Login {status}, creating a job to verify 
{user}, result so far: {result}',
+                       [
+                               'function' => __METHOD__,
+                               'status' => $type,
+                               'user' => $user->getName(),
+                               'result' => $resultSoFar,
+                       ]
+               );
        }
 
        /**

-- 
To view, visit https://gerrit.wikimedia.org/r/373170
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6cd0a8f953fd823d33bba60df3b9dcfe51d4b4a3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LoginNotify
Gerrit-Branch: master
Gerrit-Owner: MaxSem <maxsem.w...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to