Added some performance logging capabilities and socket cleanup for new broadcast thread sockets

This commit is contained in:
Mark Vejvoda
2010-04-15 01:19:00 +00:00
parent 86f0b8adb0
commit 30c4eb2b96
12 changed files with 108 additions and 38 deletions

View File

@@ -35,12 +35,14 @@ using namespace Shared::Platform;
namespace Shared{ namespace Util{
bool SystemFlags::enableDebugText = false;
bool SystemFlags::enableNetworkDebugInfo = false;
const char * SystemFlags::debugLogFile = NULL;
bool SystemFlags::enableDebugText = false;
bool SystemFlags::enableNetworkDebugInfo = false;
bool SystemFlags::enablePerformanceDebugInfo = false;
const char * SystemFlags::debugLogFile = NULL;
ofstream SystemFlags::fileStream;
int SystemFlags::lockFile = -1;
string SystemFlags::lockfilename = "";
int SystemFlags::lockFile = -1;
string SystemFlags::lockfilename = "";
inline bool acquire_file_lock(int hnd)
{
@@ -82,8 +84,9 @@ void SystemFlags::Close() {
}
void SystemFlags::OutputDebug(DebugType type, const char *fmt, ...) {
if((type == debugSystem && SystemFlags::enableDebugText == false) ||
(type == debugNetwork && SystemFlags::enableNetworkDebugInfo == false)) {
if((type == debugSystem && SystemFlags::enableDebugText == false) ||
(type == debugNetwork && SystemFlags::enableNetworkDebugInfo == false ||
type == debugPerformance && SystemFlags::enablePerformanceDebugInfo == false)) {
return;
}