From ad240ebc225cc35859814a540a78b12d570fa985 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Thu, 19 Apr 2012 15:50:44 +0200 Subject: [PATCH] group memcached debug logs When enabling memcached debug logs ($wgMemCachedDebug), they are unconditionally sent to the main $wgDebugLogFile. This patch make it possible to sent thoses specific log to an alternate file by setting $wgDebugLogGroups['memcached'] Change-Id: I85d8ab92471ce3c31f8168dae83fe91e95e18dce --- RELEASE-NOTES-1.20 | 2 ++ includes/objectcache/MemcachedClient.php | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES-1.20 b/RELEASE-NOTES-1.20 index 3f5a314edd..9f9c380450 100644 --- a/RELEASE-NOTES-1.20 +++ b/RELEASE-NOTES-1.20 @@ -40,6 +40,8 @@ production. * (bug 27757) new API command just for retrieving tokens (not page-based) * Added GitViewers hook for extensions using external git repositories to have a web-based repository viewer linked to from Special:Version. +* Memcached debug logs can now be sent to their own file logs by setting + $wgDebugLogFile['memcached'] to some filepath. === Bug fixes in 1.20 === * (bug 30245) Use the correct way to construct a log page title. diff --git a/includes/objectcache/MemcachedClient.php b/includes/objectcache/MemcachedClient.php index 4f49f7ddfb..2815fee3e6 100644 --- a/includes/objectcache/MemcachedClient.php +++ b/includes/objectcache/MemcachedClient.php @@ -1139,7 +1139,13 @@ class MWMemcached { // }}} class MemCachedClientforWiki extends MWMemcached { + function _debugprint( $text ) { - wfDebug( "memcached: $text" ); + global $wgDebugLogGroups; + if( !isset( $wgDebugLogGroups['memcached'] ) ) { + # Prefix message since it will end up in main debug log file + $text = "memcached: $text"; + } + wfDebugLog( 'memcached', $text ); } } -- 2.20.1