* 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
This commit is contained in:
@@ -31,16 +31,18 @@
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#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
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
* Stefano Ceccherini
|
||||
* Clemens Zeidler, [email protected]
|
||||
*/
|
||||
#ifndef MOUSE_INPUT_DEVICE_H
|
||||
#define MOUSE_INPUT_DEVICE_H
|
||||
#ifndef TOUCHPAD_INPUT_DEVICE_H
|
||||
#define TOUCHPAD_INPUT_DEVICE_H
|
||||
|
||||
|
||||
#include <InputServerDevice.h>
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <ObjectList.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#define DEBUG 1
|
||||
|
||||
|
||||
class TouchpadDevice;
|
||||
|
||||
@@ -46,12 +46,8 @@ public:
|
||||
status_t _RemoveDevice(const char* path);
|
||||
|
||||
BObjectList<TouchpadDevice> fDevices;
|
||||
#ifdef DEBUG
|
||||
public:
|
||||
static FILE* sLogFile;
|
||||
#endif
|
||||
};
|
||||
|
||||
extern "C" BInputServerDevice* instantiate_input_device();
|
||||
|
||||
#endif // MOUSE_INPUT_DEVICE_H
|
||||
#endif // TOUCHPAD_INPUT_DEVICE_H
|
||||
|
||||
Reference in New Issue
Block a user