コード例 #1
0
ファイル: log.cpp プロジェクト: ronj/invent
 /** Same as the Shutdown above but called by the destructor of the LogWorker, thus ensuring that no further
  *  LOG(...) calls can happen to  a non-existing LogWorker. 
  *  @param active MUST BE the LogWorker initialized for logging. If it is not then this call is just ignored
  *         and the logging continues to be active.
  * @return true if the correct worker was given,. and shutDownLogging was called 
  */
 bool shutDownLoggingForActiveOnly(LogWorker* active) {
    if (isLoggingInitialized() && nullptr != active && (active != g_logger_instance)) {
       LOG(WARNING) << "\n\t\tAttempted to shut down logging, but the ID of the Logger is not the one that is active."
               << "\n\t\tHaving multiple instances of the g2::LogWorker is likely a BUG"
               << "\n\t\tEither way, this call to shutDownLogging was ignored"
               << "\n\t\tTry g2::internal::shutDownLogging() instead";
       return false;
    }
    shutDownLogging();
    return true;
 }
コード例 #2
0
ファイル: g2log.cpp プロジェクト: zzchu/wme-ref-app
bool shutDownLoggingForActiveOnly(g2LogWorker* active) 
{
  if(internal::isLoggingInitialized() && nullptr != active  && 
    (dynamic_cast<void*>(active) != dynamic_cast<void*>(g_logger_instance))) 
  {
     LOG(WARNING) << "\n\t\tShutting down logging, but the ID of the Logger is not the one that is active."
                  << "\n\t\tHaving multiple instances of the g2::LogWorker is likely a BUG"
                  << "\n\t\tEither way, this call to shutDownLogging was ignored";
     return false;
   }
   shutDownLogging();
   return true;
}