Esempio n. 1
0
bool Log(const char *szMessage)
{
	if (!Application.AssertMainThread()) return false;
	if (iDisableLog) return true;
	// security
	if (!szMessage) return false;

#ifndef NOAULDEBUG
	// Pass on to debugger
	if (C4AulDebug *pDebug = C4AulDebug::GetDebugger())
		pDebug->OnLog(szMessage);
#endif
	// Pass on to console
	Console.Out(szMessage);
	// pass on to lobby
	C4GameLobby::MainDlg *pLobby = ::Network.GetLobby();
	if (pLobby) pLobby->OnLog(szMessage);

	// Add message to log buffer
	bool fNotifyMsgBoard = false;
	if (::GraphicsSystem.MessageBoard)
	{
		::GraphicsSystem.MessageBoard->AddLog(szMessage);
		fNotifyMsgBoard = true;
	}

	// log
	LogSilent(szMessage, true);

	// Notify message board
	if (fNotifyMsgBoard) ::GraphicsSystem.MessageBoard->LogNotify();

	return true;
}
Esempio n. 2
0
bool Log(const char *szMessage) {
  if (!Application.AssertMainThread()) return false;
  if (iDisableLog) return true;
  // security
  if (!szMessage) return false;
  // Pass on to console
  Console.Out(szMessage);
  // pass on to lobby
  C4GameLobby::MainDlg *pLobby = Game.Network.GetLobby();
  if (pLobby && Game.pGUI) pLobby->OnLog(szMessage);

  // Add message to log buffer
  bool fNotifyMsgBoard = false;
  if (Game.GraphicsSystem.MessageBoard.Active) {
    Game.GraphicsSystem.MessageBoard.AddLog(szMessage);
    fNotifyMsgBoard = true;
  }

  // log
  LogSilent(szMessage, true);

  // Notify message board
  if (fNotifyMsgBoard) Game.GraphicsSystem.MessageBoard.LogNotify();

  return true;
}