Add debug setting to disable log throttling

Sat, 14 May 2016 13:09:40 +0200

author
Ansariel
date
Sat, 14 May 2016 13:09:40 +0200
changeset 48985
bc44446b66d7
parent 48984
2b552a915591
child 48986
432427d3fa45

Add debug setting to disable log throttling

indra/llcommon/nd/ndlogthrottle.cpp file | annotate | diff | revisions
indra/llcommon/nd/ndlogthrottle.h file | annotate | diff | revisions
indra/newview/app_settings/settings.xml file | annotate | diff | revisions
indra/newview/llappviewer.cpp file | annotate | diff | revisions
indra/newview/llviewercontrol.cpp file | annotate | diff | revisions
     1.1 --- a/indra/llcommon/nd/ndlogthrottle.cpp	Wed May 11 11:57:36 2016 +0200
     1.2 +++ b/indra/llcommon/nd/ndlogthrottle.cpp	Sat May 14 13:09:40 2016 +0200
     1.3 @@ -38,6 +38,8 @@
     1.4  		const U64 initialThrottle = 5*1000*1000; // 5 seconds
     1.5  		const U64 resetAfter = 30*1000*1000;
     1.6  
     1.7 +		bool logThrottleEnabled = true;
     1.8 +
     1.9  		struct CallSiteCall
    1.10  		{
    1.11  			char const *mFile;
    1.12 @@ -74,6 +76,11 @@
    1.13  		{
    1.14  			// Only called from Log::flush and protected by LogLock
    1.15  			
    1.16 +			if (!logThrottleEnabled)
    1.17 +			{
    1.18 +				return false;
    1.19 +			}
    1.20 +
    1.21  			static std::set< CallSiteCall > stCalls;
    1.22  
    1.23  			CallSiteCall oCall( aFile, aLine );
    1.24 @@ -129,6 +136,11 @@
    1.25  			
    1.26  			return false;
    1.27  		}
    1.28 +
    1.29 +		void setThrottleEnabled(bool enabled)
    1.30 +		{
    1.31 +			logThrottleEnabled = enabled;
    1.32 +		}
    1.33  	}
    1.34  }
    1.35  
     2.1 --- a/indra/llcommon/nd/ndlogthrottle.h	Wed May 11 11:57:36 2016 +0200
     2.2 +++ b/indra/llcommon/nd/ndlogthrottle.h	Sat May 14 13:09:40 2016 +0200
     2.3 @@ -32,7 +32,7 @@
     2.4  	namespace logging
     2.5  	{
     2.6  		bool throttle( char const *aFile, int aLine, std::ostream *aOut );
     2.7 -		
     2.8 +		void setThrottleEnabled(bool enabled);
     2.9  	}
    2.10  }
    2.11  
     3.1 --- a/indra/newview/app_settings/settings.xml	Wed May 11 11:57:36 2016 +0200
     3.2 +++ b/indra/newview/app_settings/settings.xml	Sat May 14 13:09:40 2016 +0200
     3.3 @@ -23863,6 +23863,19 @@
     3.4        <key>Value</key>
     3.5        <integer>0</integer>
     3.6      </map>
     3.7 +    <key>FSEnableLogThrottle</key>
     3.8 +    <map>
     3.9 +      <key>Comment</key>
    3.10 +      <string>Enables throttling for writing to the log file to prevent spam</string>
    3.11 +      <key>Persist</key>
    3.12 +      <integer>1</integer>
    3.13 +      <key>Type</key>
    3.14 +      <string>Boolean</string>
    3.15 +      <key>Value</key>
    3.16 +      <integer>1</integer>
    3.17 +      <key>Backup</key>
    3.18 +      <integer>0</integer>
    3.19 +    </map>
    3.20    </map>
    3.21  </llsd>
    3.22  
     4.1 --- a/indra/newview/llappviewer.cpp	Wed May 11 11:57:36 2016 +0200
     4.2 +++ b/indra/newview/llappviewer.cpp	Sat May 14 13:09:40 2016 +0200
     4.3 @@ -254,7 +254,6 @@
     4.4  #include "growlmanager.h"
     4.5  #endif
     4.6  
     4.7 -
     4.8  // *FIX: These extern globals should be cleaned up.
     4.9  // The globals either represent state/config/resource-storage of either 
    4.10  // this app, or another 'component' of the viewer. App globals should be 
    4.11 @@ -271,6 +270,7 @@
    4.12  
    4.13  #include "nd/ndoctreelog.h" // <FS:ND/> Octree operation logging.
    4.14  #include "nd/ndetw.h" // <FS:ND/> Windows Event Tracing, does nothing on OSX/Linux.
    4.15 +#include "nd/ndlogthrottle.h"
    4.16  
    4.17  #include "fsradar.h"
    4.18  
    4.19 @@ -2873,6 +2873,9 @@
    4.20  	}
    4.21  	//</FS:Techwolf Lupindo>
    4.22  
    4.23 +	// <FS:Ansariel> Debug setting to disable log throttle
    4.24 +	nd::logging::setThrottleEnabled(gSavedSettings.getBOOL("FSEnableLogThrottle"));
    4.25 +
    4.26  	initStrings(); // setup paths for LLTrans based on settings files only
    4.27  	// - set procedural settings
    4.28  	// Note: can't use LL_PATH_PER_SL_ACCOUNT for any of these since we haven't logged in yet
     5.1 --- a/indra/newview/llviewercontrol.cpp	Wed May 11 11:57:36 2016 +0200
     5.2 +++ b/indra/newview/llviewercontrol.cpp	Sat May 14 13:09:40 2016 +0200
     5.3 @@ -97,6 +97,7 @@
     5.4  #include "NACLantispam.h"
     5.5  #include "llviewerkeyboard.h"
     5.6  #include "llviewerregion.h"
     5.7 +#include "nd/ndlogthrottle.h"
     5.8  
     5.9  // Third party library includes
    5.10  #include <boost/algorithm/string.hpp>
    5.11 @@ -901,6 +902,13 @@
    5.12  }
    5.13  // </FS:Ansariel>
    5.14  
    5.15 +// <FS:Ansariel> Debug setting to disable log throttle
    5.16 +void handleLogThrottleChanged(const LLSD& newvalue)
    5.17 +{
    5.18 +	nd::logging::setThrottleEnabled(newvalue.asBoolean());
    5.19 +}
    5.20 +// </FS:Ansariel>
    5.21 +
    5.22  ////////////////////////////////////////////////////////////////////////////
    5.23  
    5.24  void settings_setup_listeners()
    5.25 @@ -1115,6 +1123,9 @@
    5.26  	//<FS:HG> FIRE-6340, FIRE-6567, FIRE-6809 - Setting Bandwidth issues
    5.27  	gSavedSettings.getControl("ThrottleBandwidthKBPS")->getSignal()->connect(boost::bind(&BandwidthUpdater::update, sBandwidthUpdater, _2));
    5.28  	gSavedSettings.getControl("FSContactListShowSearch")->getSignal()->connect(boost::bind(&handleContactListShowSearchChanged, _2));
    5.29 +
    5.30 +	// <FS:Ansariel> Debug setting to disable log throttle
    5.31 +	gSavedSettings.getControl("FSEnableLogThrottle")->getSignal()->connect(boost::bind(&handleLogThrottleChanged, _2));
    5.32  }
    5.33  
    5.34  #if TEST_CACHED_CONTROL

mercurial