Satisfy Issue 100: When timestamp it set to include seconds, the seconds do not get included with IM & chat logs.

Best viewed without space changes.
SecondsInLog debug setting added.
Seconds in Log timestamps checkbox added to Adv. Chat prefs.
This commit is contained in:
Lirusaito
2012-12-31 04:54:59 -05:00
parent 469f76e690
commit f94f4a1191
5 changed files with 24 additions and 2 deletions

View File

@@ -88,11 +88,18 @@ std::string LLLogChat::timestamp(bool withdate)
// it's daylight savings time there.
timep = utc_to_pacific_time(utc_time, gPacificDaylightTime);
static LLCachedControl<bool> withseconds("SecondsInLog");
std::string text;
if (withdate)
text = llformat("[%d/%02d/%02d %02d:%02d] ", (timep->tm_year-100)+2000, timep->tm_mon+1, timep->tm_mday, timep->tm_hour, timep->tm_min);
if (withseconds)
text = llformat("[%d-%02d-%02d %02d:%02d:%02d] ", (timep->tm_year-100)+2000, timep->tm_mon+1, timep->tm_mday, timep->tm_hour, timep->tm_min, timep->tm_sec);
else
text = llformat("[%d/%02d/%02d %02d:%02d] ", (timep->tm_year-100)+2000, timep->tm_mon+1, timep->tm_mday, timep->tm_hour, timep->tm_min);
else
text = llformat("[%02d:%02d] ", timep->tm_hour, timep->tm_min);
if (withseconds)
text = llformat("[%02d:%02d:%02d] ", timep->tm_hour, timep->tm_min, timep->tm_sec);
else
text = llformat("[%02d:%02d] ", timep->tm_hour, timep->tm_min);
return text;
}