OpenTTD
|
Functions related to debugging. More...
#include "cpu.h"
Go to the source code of this file.
Macros | |
#define | DEBUG(name, level, ...) if ((level) == 0 || _debug_ ## name ## _level >= (level)) debug(#name, __VA_ARGS__) |
Output a line of debugging information. More... | |
#define | FILE_LINE __FILE__, __LINE__ |
#define | TIC() |
#define | TOC(str, count) |
Functions | |
void CDECL | debug (const char *dbg, const char *format,...) WARN_FORMAT(2 |
void CDECL char * | DumpDebugFacilityNames (char *buf, char *last) |
Dump the available debug facility names in the help text. More... | |
void | SetDebugString (const char *s) |
Set debugging levels by parsing the text in s. More... | |
const char * | GetDebugString () |
Print out the current debug-level. More... | |
void | ShowInfo (const char *str) |
void CDECL | ShowInfoF (const char *str,...) WARN_FORMAT(1 |
void CDECL const char * | GetLogPrefix () |
Get the prefix for logs; if show_date_in_logs is enabled it returns the date, otherwise it returns nothing. More... | |
Variables | |
int | _debug_driver_level |
int | _debug_grf_level |
int | _debug_map_level |
int | _debug_misc_level |
int | _debug_net_level |
int | _debug_sprite_level |
int | _debug_oldloader_level |
int | _debug_npf_level |
int | _debug_yapf_level |
int | _debug_freetype_level |
int | _debug_script_level |
int | _debug_sl_level |
int | _debug_gamelog_level |
int | _debug_desync_level |
int | _debug_console_level |
uint32 | _realtime_tick |
The real time in the game. More... | |
Functions related to debugging.
Definition in file debug.h.
#define DEBUG | ( | name, | |
level, | |||
... | |||
) | if ((level) == 0 || _debug_ ## name ## _level >= (level)) debug(#name, __VA_ARGS__) |
Output a line of debugging information.
name | Category |
level | Debugging level, higher levels means more detailed information. |
Definition at line 39 of file debug.h.
Referenced by TCPListenHandler< ServerNetworkGameSocketHandler, PACKET_SERVER_FULL, PACKET_SERVER_BANNED >::AcceptClient(), SmallSet< Tdir, items >::Add(), Squirrel::AddClassBegin(), BaseMedia< GraphicsSet >::AddFile(), AllocateMap(), CompanyStationsWindow::BuildStationsList(), Vehicle::CancelReservation(), CheckExternalFiles(), FreeTypeFontCache::ClearFontCache(), TCPListenHandler< ServerNetworkGameSocketHandler, PACKET_SERVER_FULL, PACKET_SERVER_BANNED >::CloseListeners(), CompactSpriteCache(), NetworkAddress::Connect(), ConnectLoopProc(), AIInfo::Constructor(), GameInfo::Constructor(), Squirrel::CreateClassInstanceVM(), OrderList::DebugCheckSanity(), ScriptInstance::Died(), DoLoad(), TarScanner::DoScan(), DoScanNewGRFFiles(), FioSeekTo(), GetDriveableTrackdirBits(), StringParameters::GetInt64(), GetUnitNumberDigits(), CanalScopeResolver::GetVariable(), IndustriesScopeResolver::GetVariable(), GenericScopeResolver::GetVariable(), ObjectScopeResolver::GetVariable(), ScopeResolver::GetVariable(), GfxLoadSprites(), GRFGetSizeOfDataSection(), grfmsg(), HandleCharMsg(), NetworkContentSocketHandler::HandlePacket(), NetworkAdminSocketHandler::HandlePacket(), NetworkGameSocketHandler::HandlePacket(), NetworkUDPSocketHandler::HandleUDPPacket(), IConsoleAliasExec(), IConsoleCmdExec(), InitQuickTimeIfNeeded(), IsGoodGRFConfigList(), Layouter::Layouter(), ListenLoopProc(), LoadGrfFile(), LoadGrfFileIndexed(), NetworkAdminCompanyInfo(), NetworkCheckRestartMap(), NetworkCoreInitialize(), NetworkFindBroadcastIPs(), NetworkGameListAddItem(), NetworkGameListRemoveItem(), NetworkShutDown(), NetworkStartUp(), NetworkUDPAdvertiseThread(), NetworkUDPBroadCast(), NetworkUDPClose(), NetworkUDPInitialize(), NetworkUDPQueryMasterServer(), NetworkUDPRemoveAdvertiseThread(), NetworkUDPSearchGame(), NetworkUpdateClientInfo(), CompanyStationsWindow::OnTick(), MusicDriver_QtMidi::PlaySong(), MusicDriver_LibTimidity::PlaySong(), png_my_error(), png_my_warning(), PositionMainToolbar(), PositionNetworkChatWindow(), PositionNewsMessage(), PositionStatusbar(), NetworkHTTPSocketHandler::Receive(), ServerNetworkUDPSocketHandler::Receive_CLIENT_GET_NEWGRFS(), MasterNetworkUDPSocketHandler::Receive_MASTER_ACK_REGISTER(), MasterNetworkUDPSocketHandler::Receive_MASTER_SESSION_KEY(), ClientNetworkGameSocketHandler::Receive_SERVER_CHECK_NEWGRFS(), ClientNetworkGameSocketHandler::Receive_SERVER_FRAME(), ClientNetworkUDPSocketHandler::Receive_SERVER_NEWGRFS(), ClientNetworkUDPSocketHandler::Receive_SERVER_RESPONSE(), NetworkUDPSocketHandler::ReceiveInvalidPacket(), NetworkContentSocketHandler::ReceiveInvalidPacket(), NetworkAdminSocketHandler::ReceiveInvalidPacket(), NetworkGameSocketHandler::ReceiveInvalidPacket(), NetworkTCPSocketHandler::ReceivePacket(), NetworkUDPSocketHandler::ReceivePackets(), ScriptScanner::RegisterScript(), RemapNewGRFStringControlCode(), SquirrelStd::require(), FileReader::Reset(), AI::ResetConfig(), NetworkAddress::Resolve(), BlitterFactory::SelectBlitter(), DriverFactoryBase::SelectDriverImpl(), AIScannerInfo::SelectRandomAI(), ServerNetworkAdminSocketHandler::Send(), NetworkGameSocketHandler::SendCommand(), NetworkUDPSocketHandler::SendPacket(), NetworkTCPSocketHandler::SendPackets(), SetFallbackFont(), MusicDriver_QtMidi::SetVolume(), MusicDriver_ExtMidi::SetVolume(), SignList::SignList(), SlFixPointers(), SlNullPointers(), MusicDriver_QtMidi::Stop(), MusicDriver_QtMidi::StopSong(), LandInfoWindow::UpdateWidgetSize(), WarnCorruptSprite(), Backup< T >::~Backup(), and ServerNetworkAdminSocketHandler::~ServerNetworkAdminSocketHandler().
#define TIC | ( | ) |
#define TOC | ( | str, | |
count | |||
) |
void CDECL char* DumpDebugFacilityNames | ( | char * | buf, |
char * | last | ||
) |
const char* GetDebugString | ( | ) |
void CDECL const char* GetLogPrefix | ( | ) |
Get the prefix for logs; if show_date_in_logs is enabled it returns the date, otherwise it returns nothing.
Definition at line 256 of file debug.cpp.
References _settings_client, ClientSettings::gui, and GUISettings::show_date_in_logs.
void SetDebugString | ( | const char * | s | ) |
Set debugging levels by parsing the text in s.
For setting individual levels a string like "net=3,grf=6"
should be used. If the string starts with a number, the number is used as global debugging level.
s | Text describing the wanted debugging levels. |
Definition at line 179 of file debug.cpp.
References endof, and ShowInfoF().
uint32 _realtime_tick |
The real time in the game.
Definition at line 48 of file debug.cpp.
Referenced by GRFFileScanner::AddFile(), ClientNetworkGameSocketHandler::CheckConnection(), ClientNetworkContentSocketHandler::Connect(), NetworkGameSocketHandler::HandlePacket(), NetworkChatMessageLoop(), NetworkUDPAdvertise(), ServerNetworkAdminSocketHandler::Send(), ClientNetworkContentSocketHandler::SendReceive(), and ServerNetworkAdminSocketHandler::ServerNetworkAdminSocketHandler().