* 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 <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#if DEBUG
|
//#define TRACE_TOUCHPAD_DEVICE
|
||||||
FILE *TouchpadInputDevice::sLogFile = NULL;
|
#ifdef TRACE_TOUCHPAD_DEVICE
|
||||||
|
# define LOG(text...) debug_printf(text)
|
||||||
# define LOG_ERR(text...) LOG(text)
|
# define LOG_ERR(text...) LOG(text)
|
||||||
#else
|
#else
|
||||||
# define LOG(text...)
|
# define LOG(text...) do {} while (0)
|
||||||
# define LOG_ERR(text...) fprintf(stderr, text)
|
# define LOG_ERR(text...) debug_printf(text)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define CALLED() LOG("%s\n", __PRETTY_FUNCTION__)
|
#define CALLED() LOG("%s\n", __PRETTY_FUNCTION__)
|
||||||
|
|
||||||
|
|
||||||
const static uint32 kMouseThreadPriority = B_FIRST_REAL_TIME_PRIORITY + 4;
|
const static uint32 kMouseThreadPriority = B_FIRST_REAL_TIME_PRIORITY + 4;
|
||||||
|
|
||||||
// "/dev/" is automatically prepended by StartMonitoringDevice()
|
// "/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 *
|
extern "C" BInputServerDevice *
|
||||||
instantiate_input_device()
|
instantiate_input_device()
|
||||||
{
|
{
|
||||||
@@ -503,9 +492,6 @@ TouchpadDevice::_BuildShortName() const
|
|||||||
|
|
||||||
TouchpadInputDevice::TouchpadInputDevice()
|
TouchpadInputDevice::TouchpadInputDevice()
|
||||||
{
|
{
|
||||||
#if DEBUG
|
|
||||||
sLogFile = fopen("/var/log/mouse_device_log.log", "a");
|
|
||||||
#endif
|
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
StartMonitoringDevice(kTouchpadDevicesDirectoryPS2);
|
StartMonitoringDevice(kTouchpadDevicesDirectoryPS2);
|
||||||
@@ -518,10 +504,6 @@ TouchpadInputDevice::~TouchpadInputDevice()
|
|||||||
CALLED();
|
CALLED();
|
||||||
StopMonitoringDevice(kTouchpadDevicesDirectoryPS2);
|
StopMonitoringDevice(kTouchpadDevicesDirectoryPS2);
|
||||||
fDevices.MakeEmpty();
|
fDevices.MakeEmpty();
|
||||||
|
|
||||||
#if DEBUG
|
|
||||||
fclose(sLogFile);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
* Stefano Ceccherini
|
* Stefano Ceccherini
|
||||||
* Clemens Zeidler, [email protected]
|
* Clemens Zeidler, [email protected]
|
||||||
*/
|
*/
|
||||||
#ifndef MOUSE_INPUT_DEVICE_H
|
#ifndef TOUCHPAD_INPUT_DEVICE_H
|
||||||
#define MOUSE_INPUT_DEVICE_H
|
#define TOUCHPAD_INPUT_DEVICE_H
|
||||||
|
|
||||||
|
|
||||||
#include <InputServerDevice.h>
|
#include <InputServerDevice.h>
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
#include <ObjectList.h>
|
#include <ObjectList.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#define DEBUG 1
|
|
||||||
|
|
||||||
class TouchpadDevice;
|
class TouchpadDevice;
|
||||||
|
|
||||||
@@ -46,12 +46,8 @@ public:
|
|||||||
status_t _RemoveDevice(const char* path);
|
status_t _RemoveDevice(const char* path);
|
||||||
|
|
||||||
BObjectList<TouchpadDevice> fDevices;
|
BObjectList<TouchpadDevice> fDevices;
|
||||||
#ifdef DEBUG
|
|
||||||
public:
|
|
||||||
static FILE* sLogFile;
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern "C" BInputServerDevice* instantiate_input_device();
|
extern "C" BInputServerDevice* instantiate_input_device();
|
||||||
|
|
||||||
#endif // MOUSE_INPUT_DEVICE_H
|
#endif // TOUCHPAD_INPUT_DEVICE_H
|
||||||
|
|||||||
Reference in New Issue
Block a user