diff --git a/src/servers/input/InputServer.cpp b/src/servers/input/InputServer.cpp index 2629c71ea6..95240910f6 100644 --- a/src/servers/input/InputServer.cpp +++ b/src/servers/input/InputServer.cpp @@ -60,10 +60,6 @@ DeviceManager InputServer::gDeviceManager; KeymapMethod InputServer::gKeymapMethod; -#if DEBUG == 2 -FILE *InputServer::sLogFile = NULL; -#endif - extern "C" _EXPORT BView* instantiate_deskbar_item(); @@ -147,11 +143,6 @@ InputServer::InputServer() fAppServerPort(-1), fCursorArea(-1) { -#if DEBUG == 2 - if (sLogFile == NULL) - sLogFile = fopen("/var/log/input_server.log", "a"); -#endif - CALLED(); gInputServer = this; @@ -225,10 +216,6 @@ InputServer::~InputServer() fAddOnManager->Quit(); _ReleaseInput(NULL); - -#if DEBUG == 2 - fclose(sLogFile); -#endif } diff --git a/src/servers/input/InputServer.h b/src/servers/input/InputServer.h index e5273322dd..504af702a1 100644 --- a/src/servers/input/InputServer.h +++ b/src/servers/input/InputServer.h @@ -42,7 +42,8 @@ class BottomlineWindow; class InputDeviceListItem { public: - InputDeviceListItem(BInputServerDevice& serverDevice, input_device_ref& device); + InputDeviceListItem(BInputServerDevice& serverDevice, + input_device_ref& device); void Start(); void Stop(); @@ -75,7 +76,8 @@ class _BDeviceAddOn_ { class _BMethodAddOn_ { public: - _BMethodAddOn_(BInputServerMethod *method, const char* name, const uchar* icon); + _BMethodAddOn_(BInputServerMethod *method, const char* name, + const uchar* icon); ~_BMethodAddOn_(); status_t SetName(const char* name); @@ -236,10 +238,6 @@ class InputServer : public BApplication { uint32* fCursorBuffer; #endif -#if DEBUG == 2 - public: - static FILE *sLogFile; -#endif }; extern InputServer* gInputServer; @@ -247,8 +245,17 @@ extern InputServer* gInputServer; #if DEBUG >= 1 # if DEBUG == 2 # undef PRINT - inline void _iprint(const char *fmt, ...) { char buf[1024]; va_list ap; va_start(ap, fmt); vsprintf(buf, fmt, ap); va_end(ap); \ - fputs(buf, InputServer::sLogFile); fflush(InputServer::sLogFile); } + inline void _iprint(const char *fmt, ...) { + FILE* log = fopen("/var/log/input_server.log", "a"); + char buf[1024]; + va_list ap; + va_start(ap, fmt); + vsprintf(buf, fmt, ap); + va_end(ap); + fputs(buf, log); + fflush(log); + fclose(log); + } # define PRINT(x) _iprint x # else # undef PRINT