|
|
@ -258,7 +258,7 @@ bool LogAcceptCategory(const char* category) |
|
|
|
* suppress printing of the timestamp when multiple calls are made that don't |
|
|
|
* suppress printing of the timestamp when multiple calls are made that don't |
|
|
|
* end in a newline. Initialize it to true, and hold it, in the calling context. |
|
|
|
* end in a newline. Initialize it to true, and hold it, in the calling context. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
static std::string LogTimestampStr(const std::string &str, bool *fStartedNewLine) |
|
|
|
static std::string LogTimestampStr(const std::string &str, std::atomic_bool *fStartedNewLine) |
|
|
|
{ |
|
|
|
{ |
|
|
|
string strStamped; |
|
|
|
string strStamped; |
|
|
|
|
|
|
|
|
|
|
@ -285,7 +285,7 @@ static std::string LogTimestampStr(const std::string &str, bool *fStartedNewLine |
|
|
|
int LogPrintStr(const std::string &str) |
|
|
|
int LogPrintStr(const std::string &str) |
|
|
|
{ |
|
|
|
{ |
|
|
|
int ret = 0; // Returns total number of characters written
|
|
|
|
int ret = 0; // Returns total number of characters written
|
|
|
|
static bool fStartedNewLine = true; |
|
|
|
static std::atomic_bool fStartedNewLine(true); |
|
|
|
|
|
|
|
|
|
|
|
string strTimestamped = LogTimestampStr(str, &fStartedNewLine); |
|
|
|
string strTimestamped = LogTimestampStr(str, &fStartedNewLine); |
|
|
|
|
|
|
|
|
|
|
|