mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-03-01 19:31:27 -05:00
remove unnecessary locking, print log entries also to stdout
This commit is contained in:
parent
fe22465869
commit
9557a5246e
@ -142,11 +142,12 @@ void rslog(const RsLog::logLvl lvl, RsLog::logInfo *info, const std::string &msg
|
|||||||
if(info->lvl == RsLog::None)
|
if(info->lvl == RsLog::None)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
RsStackMutex stack(logMtx); /******** LOCKED ****************/
|
|
||||||
|
|
||||||
bool process = info->lvl == RsLog::Default ? (lvl <= defaultLevel) : lvl <= info->lvl;
|
bool process = info->lvl == RsLog::Default ? (lvl <= defaultLevel) : lvl <= info->lvl;
|
||||||
if(process)
|
if(!process)
|
||||||
|
return;
|
||||||
|
|
||||||
{
|
{
|
||||||
|
RsStackMutex stack(logMtx); /******** LOCKED ****************/
|
||||||
time_t t = time(NULL);
|
time_t t = time(NULL);
|
||||||
|
|
||||||
if (debugMode == RS_DEBUG_LOGCRASH)
|
if (debugMode == RS_DEBUG_LOGCRASH)
|
||||||
@ -179,6 +180,9 @@ void rslog(const RsLog::logLvl lvl, RsLog::logInfo *info, const std::string &msg
|
|||||||
fprintf(ofd, "(%s Z: %s, lvl: %u): %s \n",
|
fprintf(ofd, "(%s Z: %s, lvl: %u): %s \n",
|
||||||
timestr2.c_str(), info->name.c_str(), (unsigned int)info->lvl, msg.c_str());
|
timestr2.c_str(), info->name.c_str(), (unsigned int)info->lvl, msg.c_str());
|
||||||
fflush(ofd);
|
fflush(ofd);
|
||||||
|
|
||||||
|
fprintf(stdout, "(%s Z: %s, lvl: %u): %s \n",
|
||||||
|
timestr2.c_str(), info->name.c_str(), (unsigned int)info->lvl, msg.c_str());
|
||||||
lineCount++;
|
lineCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user