mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 12:32:48 +01:00
Changed logging to make -logtimestamps to work also for -printtoconsole
This commit is contained in:
parent
4f44530bc3
commit
58981d4f7d
@ -280,10 +280,13 @@ 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 bool fStartedNewLine = true;
|
||||||
|
|
||||||
|
string strTimestamped = LogTimestampStr(str, &fStartedNewLine);
|
||||||
|
|
||||||
if (fPrintToConsole)
|
if (fPrintToConsole)
|
||||||
{
|
{
|
||||||
// print to console
|
// print to console
|
||||||
ret = fwrite(str.data(), 1, str.size(), stdout);
|
ret = fwrite(strTimestamped.data(), 1, strTimestamped.size(), stdout);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
else if (fPrintToDebugLog)
|
else if (fPrintToDebugLog)
|
||||||
@ -291,8 +294,6 @@ int LogPrintStr(const std::string &str)
|
|||||||
boost::call_once(&DebugPrintInit, debugPrintInitFlag);
|
boost::call_once(&DebugPrintInit, debugPrintInitFlag);
|
||||||
boost::mutex::scoped_lock scoped_lock(*mutexDebugLog);
|
boost::mutex::scoped_lock scoped_lock(*mutexDebugLog);
|
||||||
|
|
||||||
string strTimestamped = LogTimestampStr(str, &fStartedNewLine);
|
|
||||||
|
|
||||||
// buffer if we haven't opened the log yet
|
// buffer if we haven't opened the log yet
|
||||||
if (fileout == NULL) {
|
if (fileout == NULL) {
|
||||||
assert(vMsgsBeforeOpenLog);
|
assert(vMsgsBeforeOpenLog);
|
||||||
|
Loading…
Reference in New Issue
Block a user