jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/402100 )

Change subject: Improved debug logging.
......................................................................


Improved debug logging.

Change-Id: Iff8282cf78ac80cce7263c2a0a2bbf9276249575
---
M includes/PluggableAuth.php
M includes/PluggableAuthHooks.php
M includes/PluggableAuthLogin.php
M includes/PluggableAuthPrimaryAuthenticationProvider.php
4 files changed, 19 insertions(+), 15 deletions(-)

Approvals:
  jenkins-bot: Verified
  MarkAHershberger: Looks good to me, approved



diff --git a/includes/PluggableAuth.php b/includes/PluggableAuth.php
index 87ea991..8ecf4e4 100644
--- a/includes/PluggableAuth.php
+++ b/includes/PluggableAuth.php
@@ -36,7 +36,10 @@
         * @return PluggableAuth a PluggableAuth object
         */
        public static function singleton() {
+               wfDebugLog( 'PluggableAuth', 'Getting PluggableAuth singleton' 
);
+               wfDebugLog( 'PluggableAuth', 'Class name: ' .  
$GLOBALS['wgPluggableAuth_Class'] );
                if ( !is_null( self::$instance ) ) {
+                       wfDebugLog( 'PluggableAuth', 'Singleton already exists' 
);
                        return self::$instance;
                } elseif ( isset( $GLOBALS['wgPluggableAuth_Class'] ) &&
                        class_exists( $GLOBALS['wgPluggableAuth_Class'] ) &&
@@ -45,7 +48,7 @@
                        self::$instance = new $GLOBALS['wgPluggableAuth_Class'];
                        return self::$instance;
                }
-               wfDebug( 'Could not get authentication plugin instance.' );
+               wfDebugLog( 'PluggableAuth', 'Could not get authentication 
plugin instance.' );
                return false;
        }
 }
diff --git a/includes/PluggableAuthHooks.php b/includes/PluggableAuthHooks.php
index 0683b45..ee1e977 100644
--- a/includes/PluggableAuthHooks.php
+++ b/includes/PluggableAuthHooks.php
@@ -89,12 +89,12 @@
                if ( $old_user === false ) {
                        return;
                }
-               wfDebug( 'Deauthenticating ' . $old_name );
+               wfDebugLog( 'PluggableAuth', 'Deauthenticating ' . $old_name );
                $pluggableauth = PluggableAuth::singleton();
                if ( $pluggableauth ) {
                        $pluggableauth->deauthenticate( $old_user );
                }
-               wfDebug( 'Deauthenticated ' . $old_name );
+               wfDebugLog( 'PluggableAuth', 'Deauthenticated ' . $old_name );
        }
 
        /**
diff --git a/includes/PluggableAuthLogin.php b/includes/PluggableAuthLogin.php
index 833bb40..7d88107 100644
--- a/includes/PluggableAuthLogin.php
+++ b/includes/PluggableAuthLogin.php
@@ -21,6 +21,7 @@
         * @param string|null $param parameters (ignored)
         */
        public function execute( $param ) {
+               wfDebugLog( 'PluggableAuth', 'In execute()' );
                $authManager = AuthManager::singleton();
                $user = $this->getUser();
                $pluggableauth = PluggableAuth::singleton();
@@ -35,11 +36,11 @@
                                        $user->mEmail = $email;
                                        $user->mEmailAuthenticated = 
wfTimestamp();
                                        $user->mTouched = wfTimestamp();
-                                       wfDebug( 'Authenticated new user: ' . 
$username );
+                                       wfDebugLog( 'PluggableAuth', 
'Authenticated new user: ' . $username );
                                } else {
                                        $user->mId = $id;
                                        $user->loadFromId();
-                                       wfDebug( 'Authenticated existing user: 
' . $user->mName );
+                                       wfDebugLog( 'PluggableAuth', 
'Authenticated existing user: ' . $user->mName );
                                }
                                Hooks::run( 'PluggableAuthPopulateGroups', [ 
$user ] );
                                $authorized = true;
@@ -51,20 +52,20 @@
                                                self::REALNAME_SESSION_KEY, 
$realname );
                                        
$authManager->setAuthenticationSessionData(
                                                self::EMAIL_SESSION_KEY, $email 
);
-                                       wfDebug( 'User is authorized.' );
+                                       wfDebugLog( 'PluggableAuth', 'User is 
authorized.' );
                                } else {
-                                       wfDebug( 'Authorization failure.' );
+                                       wfDebugLog( 'PluggableAuth', 
'Authorization failure.' );
                                        $error = wfMessage( 
'pluggableauth-not-authorized', $username )->text();
                                }
                        } else {
-                               wfDebug( 'Authentication failure.' );
+                               wfDebugLog( 'PluggableAuth', 'Authentication 
failure.' );
                                if ( is_null( $error ) ) {
                                        $error = wfMessage( 
'pluggableauth-authentication-failure' )->text();
                                } else {
                                        if ( !is_string( $error ) ) {
                                                $error = strval( $error );
                                        }
-                                       wfDebug( 'ERROR: ' . $error );
+                                       wfDebugLog( 'PluggableAuth', 'ERROR: ' 
. $error );
                                }
                        }
                }
@@ -75,7 +76,7 @@
                $returnToUrl = $authManager->getAuthenticationSessionData(
                        self::RETURNTOURL_SESSION_KEY );
                if ( is_null( $returnToUrl ) || count( $returnToUrl ) === 0 ) {
-                       wfDebug( 'ERROR: return to URL is null or empty' );
+                       wfDebugLog( 'PluggableAuth', 'ERROR: return to URL is 
null or empty' );
                } else {
                        $this->getOutput()->redirect( $returnToUrl );
                }
diff --git a/includes/PluggableAuthPrimaryAuthenticationProvider.php 
b/includes/PluggableAuthPrimaryAuthenticationProvider.php
index ef90ac6..f2b13fa 100644
--- a/includes/PluggableAuthPrimaryAuthenticationProvider.php
+++ b/includes/PluggableAuthPrimaryAuthenticationProvider.php
@@ -97,20 +97,20 @@
                        PluggableAuthLogin::EMAIL_SESSION_KEY );
                if ( $user->mRealName != $realname || $user->mEmail != $email ) 
{
                        if ( $GLOBALS['wgPluggableAuth_EnableLocalProperties'] 
&& !$force ) {
-                               wfDebug( 'Local properties enabled.' );
-                               wfDebug( 'Did not save updated real name and 
email address.' );
+                               wfDebugLog( 'PluggableAuth', 'Local properties 
enabled.' );
+                               wfDebugLog( 'PluggableAuth', 'Did not save 
updated real name and email address.' );
                        } else {
-                               wfDebug( 'Local properties disabled or has just 
been created.' );
+                               wfDebugLog( 'PluggableAuth', 'Local properties 
disabled or has just been created.' );
                                $user->mRealName = $realname;
                                if ( $email && Sanitizer::validateEmail( $email 
) ) {
                                        $user->mEmail = $email;
                                        $user->confirmEmail();
                                }
                                $user->saveSettings();
-                               wfDebug( 'Saved updated real name and email 
address.' );
+                               wfDebugLog( 'PluggableAuth', 'Saved updated 
real name and email address.' );
                        }
                } else {
-                       wfDebug( 'Real name and email address did not change.' 
);
+                       wfDebugLog( 'PluggableAuth', 'Real name and email 
address did not change.' );
                }
        }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iff8282cf78ac80cce7263c2a0a2bbf9276249575
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PluggableAuth
Gerrit-Branch: master
Gerrit-Owner: Cicalese <[email protected]>
Gerrit-Reviewer: MarkAHershberger <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to