jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/373330 )
Change subject: Log the heck out of everything
......................................................................
Log the heck out of everything
Bug: T173888
Change-Id: I6cd0a8f953fd823d33bba60df3b9dcfe51d4b4a3
(cherry picked from commit ffae5375dfe59c6829b80326d80b6295e19fe5f4)
---
M includes/LoginNotify.php
1 file changed, 38 insertions(+), 6 deletions(-)
Approvals:
Niharika29: Looks good to me, approved
MaxSem: Looks good to me, approved
jenkins-bot: Verified
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/373330
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I6cd0a8f953fd823d33bba60df3b9dcfe51d4b4a3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LoginNotify
Gerrit-Branch: wmf/1.30.0-wmf.15
Gerrit-Owner: MaxSem <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: Niharika29 <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits