From 855012f2bdf73e133ba478585cde86e32b50d977 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sun, 2 Nov 2008 12:55:18 +0000 Subject: [PATCH] * Followed a suggestion made by Axel and removed the custom logfile solution and replaced it by dumping output to the syslog. (Also disabled debug output by default.) * Fixed wrong header guard. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28463 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../devices/touchpad/TouchpadInputDevice.cpp | 30 ++++--------------- .../devices/touchpad/TouchpadInputDevice.h | 12 +++----- 2 files changed, 10 insertions(+), 32 deletions(-) diff --git a/src/add-ons/input_server/devices/touchpad/TouchpadInputDevice.cpp b/src/add-ons/input_server/devices/touchpad/TouchpadInputDevice.cpp index 4fd9885a5c..59f1038cc4 100644 --- a/src/add-ons/input_server/devices/touchpad/TouchpadInputDevice.cpp +++ b/src/add-ons/input_server/devices/touchpad/TouchpadInputDevice.cpp @@ -31,16 +31,18 @@ #include #include -#if DEBUG -FILE *TouchpadInputDevice::sLogFile = NULL; +//#define TRACE_TOUCHPAD_DEVICE +#ifdef TRACE_TOUCHPAD_DEVICE +# define LOG(text...) debug_printf(text) # define LOG_ERR(text...) LOG(text) #else -# define LOG(text...) -# define LOG_ERR(text...) fprintf(stderr, text) +# define LOG(text...) do {} while (0) +# define LOG_ERR(text...) debug_printf(text) #endif #define CALLED() LOG("%s\n", __PRETTY_FUNCTION__) + const static uint32 kMouseThreadPriority = B_FIRST_REAL_TIME_PRIORITY + 4; // "/dev/" is automatically prepended by StartMonitoringDevice() @@ -95,19 +97,6 @@ class TouchpadDevice { }; -#if DEBUG -inline void -LOG(const char *fmt, ...) -{ - char buf[1024]; - va_list ap; - va_start(ap, fmt); - vsprintf(buf, fmt, ap); va_end(ap); - fputs(buf, TouchpadInputDevice::sLogFile); fflush(TouchpadInputDevice::sLogFile); -} -#endif - - extern "C" BInputServerDevice * instantiate_input_device() { @@ -503,9 +492,6 @@ TouchpadDevice::_BuildShortName() const TouchpadInputDevice::TouchpadInputDevice() { -#if DEBUG - sLogFile = fopen("/var/log/mouse_device_log.log", "a"); -#endif CALLED(); StartMonitoringDevice(kTouchpadDevicesDirectoryPS2); @@ -518,10 +504,6 @@ TouchpadInputDevice::~TouchpadInputDevice() CALLED(); StopMonitoringDevice(kTouchpadDevicesDirectoryPS2); fDevices.MakeEmpty(); - -#if DEBUG - fclose(sLogFile); -#endif } diff --git a/src/add-ons/input_server/devices/touchpad/TouchpadInputDevice.h b/src/add-ons/input_server/devices/touchpad/TouchpadInputDevice.h index 06a053f4bb..4d0aa9157a 100644 --- a/src/add-ons/input_server/devices/touchpad/TouchpadInputDevice.h +++ b/src/add-ons/input_server/devices/touchpad/TouchpadInputDevice.h @@ -6,8 +6,8 @@ * Stefano Ceccherini * Clemens Zeidler, haiku@clemens-zeidler.de */ -#ifndef MOUSE_INPUT_DEVICE_H -#define MOUSE_INPUT_DEVICE_H +#ifndef TOUCHPAD_INPUT_DEVICE_H +#define TOUCHPAD_INPUT_DEVICE_H #include @@ -16,7 +16,7 @@ #include #include -#define DEBUG 1 + class TouchpadDevice; @@ -46,12 +46,8 @@ public: status_t _RemoveDevice(const char* path); BObjectList fDevices; -#ifdef DEBUG -public: - static FILE* sLogFile; -#endif }; extern "C" BInputServerDevice* instantiate_input_device(); -#endif // MOUSE_INPUT_DEVICE_H +#endif // TOUCHPAD_INPUT_DEVICE_H