diff --git a/common/rfb/VNCSConnectionST.cxx b/common/rfb/VNCSConnectionST.cxx index 41c00d4..5629ed6 100644 --- a/common/rfb/VNCSConnectionST.cxx +++ b/common/rfb/VNCSConnectionST.cxx @@ -831,9 +831,11 @@ void VNCSConnectionST::keyEvent(rdr::U32 keysym, rdr::U32 keycode, bool down) { if (down) { keylog(keysym, sock->getPeerAddress()); kbdLogTimer.start(60 * 1000); - vlog.debug("Key pressed: 0x%x / 0x%x", keysym, keycode); + if (Server::DLP_ClipLog[0] == 'v') + vlog.debug("Key pressed: 0x%x / 0x%x", keysym, keycode); } else { - vlog.debug("Key released: 0x%x / 0x%x", keysym, keycode); + if (Server::DLP_ClipLog[0] == 'v') + vlog.debug("Key released: 0x%x / 0x%x", keysym, keycode); } // Remap the key if required diff --git a/unix/xserver/hw/vnc/Input.c b/unix/xserver/hw/vnc/Input.c index aa16e59..62404d7 100644 --- a/unix/xserver/hw/vnc/Input.c +++ b/unix/xserver/hw/vnc/Input.c @@ -83,6 +83,7 @@ static void vncKeysymKeyboardEvent(KeySym keysym, int down); #define LOG_STATUS(...) vncLogStatus(LOG_NAME, __VA_ARGS__) #define LOG_INFO(...) vncLogInfo(LOG_NAME, __VA_ARGS__) #define LOG_DEBUG(...) vncLogDebug(LOG_NAME, __VA_ARGS__) +#define LOG_DLP_VERBOSE(...) vncLogDLPVerbose(LOG_NAME, __VA_ARGS__) /* * Init input device. @@ -406,7 +407,7 @@ static inline void pressKey(DeviceIntPtr dev, int kc, Bool down, const char *msg #endif if (msg != NULL) - LOG_DEBUG("%s %d %s", msg, kc, down ? "down" : "up"); + LOG_DLP_VERBOSE("%s %d %s", msg, kc, down ? "down" : "up"); action = down ? KeyPress : KeyRelease; #if XORG < 111 diff --git a/unix/xserver/hw/vnc/RFBGlue.cc b/unix/xserver/hw/vnc/RFBGlue.cc index 7c32bea..486c5ab 100644 --- a/unix/xserver/hw/vnc/RFBGlue.cc +++ b/unix/xserver/hw/vnc/RFBGlue.cc @@ -24,6 +24,7 @@ #include #include #include +#include #include "RFBGlue.h" @@ -89,6 +90,20 @@ void vncLogDebug(const char *name, const char *format, ...) va_end(ap); } +void vncLogDLPVerbose(const char *name, const char *format, ...) +{ + if (Server::DLP_ClipLog[0] != 'v') + return; + LogWriter *vlog; + va_list ap; + vlog = LogWriter::getLogWriter(name); + if (vlog == NULL) + return; + va_start(ap, format); + vlog->vdebug(format, ap); + va_end(ap); +} + int vncSetParam(const char *name, const char *value) { if (value != NULL) diff --git a/unix/xserver/hw/vnc/RFBGlue.h b/unix/xserver/hw/vnc/RFBGlue.h index 695cea1..53fabf7 100644 --- a/unix/xserver/hw/vnc/RFBGlue.h +++ b/unix/xserver/hw/vnc/RFBGlue.h @@ -36,6 +36,7 @@ void vncLogError(const char *name, const char *format, ...) __printf_attr(2, 3); void vncLogStatus(const char *name, const char *format, ...) __printf_attr(2, 3); void vncLogInfo(const char *name, const char *format, ...) __printf_attr(2, 3); void vncLogDebug(const char *name, const char *format, ...) __printf_attr(2, 3); +void vncLogDLPVerbose(const char *name, const char *format, ...) __printf_attr(2, 3); int vncSetParam(const char *name, const char *value); int vncSetParamSimple(const char *nameAndValue);