Esempio n. 1
0
void Log::LogMessage( int prio, const char* category, const char* function, const char* fmt, ... )
{
    if( prio > g_priorityLimit )
    {
        return;
    }

	va_list args;
	va_start( args, fmt );
	std::string msg = vFormatString( fmt, args );
	va_end( args );

	do_log_msg( prio, category, function,msg.c_str() );
}
Esempio n. 2
0
int cdecl vMessage (UINT type, LONG title, LONG text, LPCTSTR fmt, va_list arg)
{
   LPMESSAGE_PARAMS pmp = New(MESSAGE_PARAMS);

   pmp->dwType = type;

   if ((pmp->pszTitle = FormatString (title, fmt, arg)) == NULL)
      {
      Delete(pmp);
      return IDCANCEL;
      }

   if ((pmp->pszText = vFormatString (text, fmt, arg)) == NULL)
      {
      FreeString (pmp->pszTitle);
      Delete(pmp);
      return IDCANCEL;
      }

   if (!( pmp->dwType & 0xF0 )) // no icon requested?  pick one.
      {
      pmp->dwType |= ((pmp->dwType & 0x0F) ? MB_ICONQUESTION : MB_ICONASTERISK);
      }

   if (pmp->dwType & MB_MODELESS)
      {
      pmp->dwType &= ~MB_MODELESS;

      HANDLE hThread;
      if ((hThread = CreateThread (NULL, 0, (LPTHREAD_START_ROUTINE)Message_ThreadProc, pmp, 0, NULL)) != NULL)
         SetThreadPriority (hThread, THREAD_PRIORITY_BELOW_NORMAL);

      return -1; // threaded--who knows what button was hit.
      }

   return Message_ThreadProc (pmp);
}