#include "C4Include.h"
#include "lib/C4Log.h"
#include "c4group/C4Components.h"
#include "editor/C4Console.h"
#include "game/C4GraphicsSystem.h"
#include "graphics/C4Shader.h"
#include "gui/C4GameLobby.h"
#include "lib/C4LogBuf.h"
#include "network/C4Network2.h"
#include "platform/C4Window.h"
#include "script/C4AulDebug.h"
Go to the source code of this file.
Functions | |
bool | OpenLog () |
bool | OpenExtraLogs () |
bool | CloseLog () |
int | GetLogFD () |
bool | LogSilent (const char *szMessage, bool fConsole) |
bool | LogSilent (const char *szMessage) |
bool | Log (const char *szMessage) |
bool | LogFatal (const char *szMessage) |
void | ResetFatalError () |
const char * | GetFatalError () |
bool | LogF (const char *strMessage,...) |
bool | LogSilentF (const char *strMessage,...) |
bool | DebugLog (const char *strMessage) |
bool | DebugLogF (const char *strMessage ...) |
size_t | GetLogPos () |
bool | GetLogSection (size_t iStart, size_t iLength, StdStrBuf &rsOut) |
bool | ShaderLog (const char *szMessage) |
bool | ShaderLogF (const char *strMessage ...) |
Variables | |
FILE * | C4LogFile =nullptr |
FILE * | C4ShaderLogFile = nullptr |
time_t | C4LogStartTime |
StdStrBuf | sLogFileName |
StdStrBuf | sFatalError |
int | iDisableLog = 0 |
bool CloseLog | ( | ) |
Definition at line 107 of file C4Log.cpp.
References C4LogFile, and C4ShaderLogFile.
Referenced by C4Application::~C4Application().
bool DebugLog | ( | const char * | strMessage | ) |
Definition at line 282 of file C4Log.cpp.
References C4Game::DebugMode, Game, Log(), and LogSilent().
Referenced by DebugLogF(), C4AulScriptContext::dump(), C4Game::LoadScenarioComponents(), C4Game::LoadScenarioSection(), OpenExtraLogs(), C4InteractiveThread::ProcessEvents(), and C4PropListScen::SetPropertyByS().
bool DebugLogF | ( | const char * | strMessage ... | ) |
Definition at line 290 of file C4Log.cpp.
References DebugLog(), StdStrBuf::FormatV(), and StdStrBuf::getData().
Referenced by C4MaterialMap::CrossMapMaterials(), C4ScenarioListLoader::SubFolder::DoLoadContents(), C4ScenarioListLoader::RegularFolder::DoLoadContents(), C4RoundResults::EvaluateGame(), C4GameObjects::FixObjectOrder(), C4AulExec::FnTranslate(), C4TextureMap::GetIndex(), C4TextureMap::GetIndexMatTex(), C4Object::GetInfoString(), C4TexMapEntry::Init(), C4ParticleDef::Load(), C4MapFolderData::Load(), C4DefGraphics::LoadBitmap(), C4Def::LoadDefCore(), C4TextureMap::LoadMap(), C4DefGraphics::LoadMesh(), C4Game::LoadScenarioSection(), C4DefGraphics::LoadSkeleton(), C4SoundSystem::NewEffect(), C4GameObjects::PostLoad(), C4MaterialReaction::ResolveScriptFuncs(), C4Landscape::SetTextureIndex(), StdCompilerWarnCallback(), and StdMeshMaterialParserCtx::WarningNotSupported().
const char* GetFatalError | ( | ) |
Definition at line 257 of file C4Log.cpp.
References StdStrBuf::getData(), and sFatalError.
Referenced by C4Startup::DoStartup().
int GetLogFD | ( | ) |
size_t GetLogPos | ( | ) |
Definition at line 298 of file C4Log.cpp.
References FileSize(), StdStrBuf::getData(), and sLogFileName.
Referenced by C4Game::Clear(), and C4Game::Init().
bool GetLogSection | ( | size_t | iStart, |
size_t | iLength, | ||
StdStrBuf & | rsOut | ||
) |
Definition at line 304 of file C4Log.cpp.
References StdStrBuf::Clear(), StdStrBuf::Copy(), StdStrBuf::getData(), StdStrBuf::getMData(), StdStrBuf::getSize(), iSize, StdStrBuf::LoadFromFile(), and sLogFileName.
Referenced by C4Startup::DoStartup().
bool Log | ( | const char * | szMessage | ) |
Definition at line 204 of file C4Log.cpp.
References Application, C4AbstractApp::AssertMainThread(), Console, C4AulDebug::GetDebugger(), C4Network2::GetLobby(), GraphicsSystem, iDisableLog, LogSilent(), C4GraphicsSystem::MessageBoard, Network, C4GameLobby::MainDlg::OnLog(), and C4ConsoleGUI::Out().
Referenced by C4GameLobby::Countdown::Abort(), C4ClientList::Add(), C4Network2ResList::AddByFile(), C4Network2ResList::AddByGroup(), C4PlayerInfoList::AssignPlayerIDs(), C4Network2IO::Broadcast(), C4ClientPlayerInfos::C4ClientPlayerInfos(), C4GamePadControl::C4GamePadControl(), C4Game::CanQuickSave(), C4Playback::Check(), C4ObjectList::CheckSort(), C4Game::Clear(), C4Application::Clear(), ConsoleDlgProc(), C4AbstractApp::Copy(), C4GameLobby::Countdown::Countdown(), CStdGL::CreateContext(), C4Network2::CreateDynamic(), DebugLog(), C4Network2Res::Derive(), C4Game::DoGameOver(), C4Application::DoInit(), C4Network2::DoLobby(), C4GraphicsSystem::DoSaveScreenshot(), C4Player::Eliminate(), C4Draw::Error(), C4Game::Evaluate(), C4GameControl::ExecControl(), C4GameControl::ExecControlPacket(), C4Network2::FinalInit(), C4Network2Res::GetStandalone(), C4Network2Players::HandlePlayerInfoUpdRequest(), C4Game::Init(), C4Game::InitControl(), C4Game::InitDefs(), C4Game::InitGame(), C4Game::InitNetworkFromAddress(), C4PlayerList::Join(), C4Network2::LeagueEnd(), C4Network2::LeaguePlrAuth(), C4Network2::LeaguePlrAuthCheck(), C4Network2::LeagueStart(), C4Network2::LeagueUpdateProcessReply(), C4Network2::LeagueWaitNotBusy(), C4AulDebug::Listen(), C4SoundEffect::Load(), C4ParticleDef::Load(), C4MaterialMap::Load(), C4Config::Load(), C4Game::LoadAdditionalSystemGroup(), C4Extra::LoadDef(), C4Language::LoadLanguage(), C4GameLobby::LobbyError(), LogF(), LogFatal(), main(), C4MainMenu::MenuCommand(), C4Network2::OnClientDisconnect(), C4GameOptionButtons::OnCommentSet(), C4GameLobby::Countdown::OnSec1Timer(), C4Game::OpenScenario(), C4Network2Res::OptimizeStandalone(), C4Application::ParseCommandLine(), C4Application::PreInit(), CStdGL::PrepareMaterial(), C4MessageInput::ProcessCommand(), C4InteractiveThread::ProcessEvents(), ProcessGroup(), C4MessageInput::ProcessInput(), C4Game::QuickSave(), C4Game::ReloadDef(), C4PlayerList::RemoveAtClient(), C4PlayerList::RemoveAtRemoteClient(), C4PlayerList::RemoveLocal(), CStdNoGfx::RestoreDeviceObjects(), C4PlayerInfoList::RestoreSavegameInfos(), C4GameSave::Save(), C4GameSaveSavegame::SaveComponents(), C4Player::SetHostility(), C4MCParserErr::show(), C4Record::Start(), C4Playback::StreamToRecord(), C4Playback::Strip(), C4Player::Surrender(), C4PlayerList::SynchronizeLocalFiles(), C4Network2::Vote(), and C4PropListNumbered::~C4PropListNumbered().
bool LogF | ( | const char * | strMessage, |
... | |||
) |
Definition at line 262 of file C4Log.cpp.
References StdStrBuf::FormatV(), StdStrBuf::getData(), and Log().
Referenced by C4Group::AccessEntry(), C4MusicFile::Announce(), C4Application::ApplyResolutionConstraints(), C4ControlJoinPlayer::C4ControlJoinPlayer(), CStdGL::CheckGLError(), C4Network2UPnPP::ClearNatMappings(), CompileFromBuf_Log(), CompileFromBuf_LogWarn(), C4ObjectList::CompileFunc(), C4Game::CompileRuntimeData(), CStdGL::CreateContext(), C4FoWAmbient::CreateFromLandscape(), CreatePath(), C4PlayerInfoList::CreateRestoreInfosForJoinedScriptPlayers(), C4Playback::DebugRecError(), DecompileToBuf_Log(), C4Value::Denumerate(), C4Application::DoInit(), C4DownloadDlg::DownloadFile(), CStdGL::Error(), C4GameControlNetwork::ExecQueuedSyncCtrl(), C4GameControlNetwork::ExecSyncControl(), C4Player::Execute(), C4Control::Execute(), C4GUI::ExpandHotkeyMarkup(), C4ComponentHost::FinishLoad(), C4Network2Res::GetStandalone(), C4ValueNumbers::GetValue(), C4TextureMap::Init(), C4SoundModifierList::Init(), C4AchievementGraphics::Init(), C4AbstractApp::Init(), C4Network2IO::Init(), C4Player::Init(), C4Player::InitControl(), C4Game::InitDefs(), C4FontLoader::InitFont(), C4MusicSystem::InitForScenario(), C4MusicSystem::InitializeMOD(), C4Game::InitMaterialTexture(), C4Game::InitNetworkFromReference(), C4Network2::Join(), C4PlayerList::Join(), C4Network2::LeagueNotifyDisconnect(), C4Network2::LeaguePlrAuth(), C4Network2::LeagueShowError(), C4Network2::LeagueUpdate(), C4Game::LinkScriptEngine(), C4AulDebug::Listen(), C4TextureShape::Load(), C4Surface::Load(), C4DefList::Load(), C4Config::Load(), C4KeyboardInput::LoadCustomConfig(), C4Extra::LoadDef(), C4MusicSystem::LoadDir(), C4GameResList::LoadFoldersWithLocalDefs(), C4PlayerInfo::LoadResource(), StdMeshSkeletonLoader::LoadSkeletonBinary(), C4TextureMap::LoadTextures(), C4PlayerInfoList::LocalJoinUnjoinedPlayersInQueue(), C4GUI::ComponentAligner::LogIt(), main(), C4Playback::Open(), C4Game::OpenScenario(), C4Value::operator==(), C4Network2Res::OptimizeStandalone(), C4Application::ParseCommandLine(), C4EditCursor::PerformDuplication(), C4MusicFileSDL::Play(), C4MusicSystem::Play(), C4Control::PreExecute(), C4MessageInput::ProcessCommand(), ProcessGroup(), Ogre::Mesh::Chunk::Read(), Ogre::Skeleton::Chunk::Read(), C4Playback::ReadBinary(), Ogre::Mesh::ChunkMesh::ReadImpl(), Ogre::Mesh::ChunkSubmesh::ReadImpl(), Ogre::Mesh::ChunkGeometry::ReadImpl(), Ogre::Skeleton::ChunkAnimation::ReadImpl(), C4PlayerInfoList::RecreatePlayerFiles(), C4PlayerInfoList::RecreatePlayers(), C4AulScriptEngine::ReLink(), C4Game::ReloadDef(), C4Game::ReloadParticle(), C4LSectors::Remove(), C4PlayerInfoList::RemoveUnassociatedPlayers(), C4LangStringTable::ReplaceStrings(), C4PlayerControlAssignment::ResolveRefs(), C4PlayerInfoList::RestoreSavegameInfos(), C4Network2::RetrieveRes(), C4Playback::ReWriteBinary(), C4Config::Save(), C4Player::Save(), C4ObjectInfo::Save(), C4GameSave::Save(), C4Game::SaveData(), C4GraphicsSystem::SaveScreenshot(), C4Player::ScenarioInit(), C4MusicSystem::ScheduleWaitTime(), C4Network2IOConnection::Send(), C4Network2ResChunk::Set(), C4Network2Res::SetByFile(), C4Object::SetOCF(), C4MusicSystem::SetPlayList(), C4Landscape::SetTextureIndex(), C4AbstractApp::SetVideoMode(), C4Playback::StreamToRecord(), C4Object::UpdateOCF(), and C4InVal::ValidateString().
bool LogFatal | ( | const char * | szMessage | ) |
Definition at line 239 of file C4Log.cpp.
References StdStrBuf::Append(), StdStrBuf::AppendChar(), FormatString(), StdStrBuf::getData(), StdStrBuf::isNull(), LoadResStr(), Log(), sFatalError, and SSearch().
Referenced by C4Game::CheckObjectEnumeration(), C4Network2ResList::CreateNetworkFolder(), C4MaterialMap::CrossMapMaterials(), C4Application::DoInit(), C4GameControlNetwork::DoInput(), C4Startup::EnsureLoaded(), C4GameControl::Execute(), C4Network2::HandleJoinData(), C4Game::Init(), C4GraphicsResource::Init(), C4Network2IO::Init(), C4LandscapeRenderGL::Init(), C4LoaderScreen::Init(), C4Game::InitControl(), C4Game::InitDefs(), C4FontLoader::InitFont(), C4StartupGraphics::InitFonts(), C4Network2::InitHost(), C4Network2::InitLeague(), C4Game::InitMaterialTexture(), C4GameRes::InitNetwork(), C4Game::InitNetworkFromAddress(), C4Game::InitNetworkFromReference(), C4Game::InitNetworkHost(), C4Game::InitPlayerControlSettings(), C4Game::InitPlayers(), C4GameControl::InitReplay(), C4Game::InitScriptEngine(), C4Network2::LeagueStart(), C4AulDebug::Listen(), C4GameParameters::Load(), C4DefList::Load(), C4Game::LoadScenarioComponents(), C4Playback::Open(), C4Game::OpenScenario(), C4Application::PreInit(), C4Game::PreInit(), C4InteractiveThread::ProcessEvents(), C4GraphicsResource::RegisterGlobalGraphics(), C4GroupSet::RegisterParentFolders(), C4LandscapeRenderGL::ReInit(), C4PlayerControlAssignment::ResolveRefs(), and C4Network2::RetrieveRes().
bool LogSilent | ( | const char * | szMessage | ) |
Definition at line 197 of file C4Log.cpp.
References LogSilent().
bool LogSilent | ( | const char * | szMessage, |
bool | fConsole | ||
) |
Definition at line 126 of file C4Log.cpp.
References Application, C4AbstractApp::AssertMainThread(), C4LogFile, Control, CStdFile::Flush(), StdStrBuf::getData(), StdStrBuf::getLength(), C4Record::GetLogFile(), StdStrBuf::getMData(), C4GameControl::GetRecord(), StdStrBuf::SetLength(), C4Markup::SkipTags(), SLen(), and CStdFile::Write().
Referenced by C4ObjectList::CheckSort(), DebugLog(), C4LSectors::Dump(), Log(), LogSilent(), LogSilentF(), C4GameLobby::MainDlg::OnMessage(), C4InteractiveThread::ProcessEvents(), C4MainStat::Show(), C4FoWLightSection::Update(), and CPNGFile::WaitForSaves().
bool LogSilentF | ( | const char * | strMessage, |
... | |||
) |
Definition at line 272 of file C4Log.cpp.
References StdStrBuf::FormatV(), StdStrBuf::getData(), and LogSilent().
Referenced by C4FoWLightSection::CalculateTriangles(), C4Network2::ChangeGameStatus(), C4ConfigNetwork::CheckPortsForCollisions(), C4Network2Res::Clear(), C4GUI::ConfirmationDialog::ConfirmationDialog(), C4Network2IO::ConnectWithSocket(), CStdGL::CreateContext(), C4Network2Client::DoConnectAttempt(), C4Network2Client::DoTCPSimultaneousOpen(), C4Network2Res::GetStandalone(), C4Network2::HandleConn(), C4Network2::HandleConnRe(), C4Network2::HandleJoinData(), C4Network2::HandleStatus(), C4Network2IO::Init(), C4Network2::OnClientDisconnect(), C4Network2::OnConnect(), C4Network2::OnConnectFail(), C4Network2::OnDisconn(), C4Network2::OnDisconnect(), C4Network2::OnStatusAck(), C4Network2Res::SetByFile(), C4Network2Res::SetByGroup(), C4MainStat::Show(), C4GUI::Screen::ShowMessage(), C4GUI::Screen::ShowMessageModal(), C4MainStat::ShowPart(), C4Game::Synchronize(), and C4FoWLightSection::Update().
bool OpenExtraLogs | ( | ) |
Definition at line 83 of file C4Log.cpp.
References C4Config::AtUserDataPath(), C4CFN_LogShader, C4ShaderLogFile, Config, DebugLog(), and C4Shader::IsLogging().
Referenced by C4Application::DoInit().
bool OpenLog | ( | ) |
Definition at line 48 of file C4Log.cpp.
References C4Config::AtUserDataPath(), C4CFN_Log, C4CFN_LogEx, C4LogFile, C4LogStartTime, Config, StdStrBuf::Format(), StdStrBuf::getData(), and sLogFileName.
Referenced by C4Application::DoInit().
void ResetFatalError | ( | ) |
Definition at line 252 of file C4Log.cpp.
References StdStrBuf::Clear(), and sFatalError.
Referenced by C4Startup::DoStartup().
bool ShaderLog | ( | const char * | szMessage | ) |
Definition at line 343 of file C4Log.cpp.
References Application, C4AbstractApp::AssertMainThread(), and C4ShaderLogFile.
Referenced by C4Shader::Init(), and ShaderLogF().
bool ShaderLogF | ( | const char * | strMessage ... | ) |
Definition at line 356 of file C4Log.cpp.
References StdStrBuf::FormatV(), StdStrBuf::getData(), and ShaderLog().
Referenced by C4Shader::Init(), and C4Shader::Refresh().
FILE* C4LogFile =nullptr |
Definition at line 41 of file C4Log.cpp.
Referenced by CloseLog(), GetLogFD(), LogSilent(), and OpenLog().
FILE* C4ShaderLogFile = nullptr |
Definition at line 42 of file C4Log.cpp.
Referenced by CloseLog(), OpenExtraLogs(), and ShaderLog().
StdStrBuf sFatalError |
Definition at line 46 of file C4Log.cpp.
Referenced by GetFatalError(), LogFatal(), and ResetFatalError().
StdStrBuf sLogFileName |
Definition at line 44 of file C4Log.cpp.
Referenced by GetLogPos(), GetLogSection(), and OpenLog().