MAINT-5200: Add DebugSlshareLogTag temp setting for developers.

This allows engaging slshare-service debug logging for a particular viewer
session without having to twiddle the slshare-service hosts.
Also fix leaky LLCore::HttpHeaders::ptr_t construction.
meow-7.2.2
Nat Goodspeed 2015-06-29 13:07:37 -04:00
parent 6696577feb
commit f779c164a2
2 changed files with 25 additions and 2 deletions

View File

@ -2370,6 +2370,17 @@
<key>Value</key>
<integer>0</integer>
</map>
<key>DebugSlshareLogTag</key>
<map>
<key>Comment</key>
<string>Request slshare-service debug logging</string>
<key>Persist</key>
<integer>0</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string/>
</map>
<key>DebugStatModeFPS</key>
<map>
<key>Comment</key>

View File

@ -41,6 +41,7 @@
#include "lltrans.h"
#include "llevents.h"
#include "llviewerregion.h"
#include "llviewercontrol.h"
#include "llfloaterwebcontent.h"
#include "llfloaterreg.h"
@ -69,8 +70,19 @@ void toast_user_for_facebook_success()
LLCore::HttpHeaders::ptr_t get_headers()
{
LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders);
httpHeaders->append("X-debug-tag", "dbgvwr");
LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders, false);
// The DebugSlshareLogTag mechanism is intended to trigger slshare-service
// debug logging. slshare-service is coded to respond to an X-debug-tag
// header by engaging debug logging for that request only. This way a
// developer need not muck with the slshare-service image to engage debug
// logging. Moreover, the value of X-debug-tag is embedded in each such
// log line so the developer can quickly find the log lines pertinent to
// THIS session.
std::string logtag(gSavedSettings.getString("DebugSlshareLogTag"));
if (! logtag.empty())
{
httpHeaders->append("X-debug-tag", logtag);
}
return httpHeaders;
}