Beispiel #1
0
void Zogger::zog(const string &msg, int level, int dest)
{
   if (level >= zotLogLevel.getInt32())
   {
      if (isRunning())
      {
         ZmsgPtr ptr(new ZmLog(msg, level, dest));
         push(ptr);
      }
      else
      {
#ifdef _WIN32
         if (dest & ZOG_STDOUT || dest & ZOG_STDERR)
         {
            // yes, this is redundant but the only way to get the log message
            // into VS's output window
            wstring wmsg(msg.begin(), msg.end());
            OutputDebugString(wmsg.c_str());
         }
#else
         if (dest & ZOG_STDOUT)
            cout << msg;
         if (dest & ZOG_STDERR)
            cerr << msg;
#endif
      }
   }
}
Beispiel #2
0
void Zogger::zog(const wstring &msg, int level, int dest)
{
   if (level >= zotLogLevel.getInt32())
   {
      string amsg(msg.begin(), msg.end());
      zog(amsg, level, dest);
   }
}