mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2025-01-08 15:08:47 +01:00
Merge branch 'feature/KASM-3371_keystroke_logging' into 'master'
Move keypress logging behind the DLP_Log verbose option Closes KASM-3371 See merge request kasm-technologies/internal/KasmVNC!71
This commit is contained in:
commit
3b1a72738e
@ -831,9 +831,11 @@ void VNCSConnectionST::keyEvent(rdr::U32 keysym, rdr::U32 keycode, bool down) {
|
|||||||
if (down) {
|
if (down) {
|
||||||
keylog(keysym, sock->getPeerAddress());
|
keylog(keysym, sock->getPeerAddress());
|
||||||
kbdLogTimer.start(60 * 1000);
|
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 {
|
} 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
|
// Remap the key if required
|
||||||
|
@ -83,6 +83,7 @@ static void vncKeysymKeyboardEvent(KeySym keysym, int down);
|
|||||||
#define LOG_STATUS(...) vncLogStatus(LOG_NAME, __VA_ARGS__)
|
#define LOG_STATUS(...) vncLogStatus(LOG_NAME, __VA_ARGS__)
|
||||||
#define LOG_INFO(...) vncLogInfo(LOG_NAME, __VA_ARGS__)
|
#define LOG_INFO(...) vncLogInfo(LOG_NAME, __VA_ARGS__)
|
||||||
#define LOG_DEBUG(...) vncLogDebug(LOG_NAME, __VA_ARGS__)
|
#define LOG_DEBUG(...) vncLogDebug(LOG_NAME, __VA_ARGS__)
|
||||||
|
#define LOG_DLP_VERBOSE(...) vncLogDLPVerbose(LOG_NAME, __VA_ARGS__)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Init input device.
|
* Init input device.
|
||||||
@ -406,7 +407,7 @@ static inline void pressKey(DeviceIntPtr dev, int kc, Bool down, const char *msg
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (msg != NULL)
|
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;
|
action = down ? KeyPress : KeyRelease;
|
||||||
#if XORG < 111
|
#if XORG < 111
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include <rfb/LogWriter.h>
|
#include <rfb/LogWriter.h>
|
||||||
#include <rfb/Logger_stdio.h>
|
#include <rfb/Logger_stdio.h>
|
||||||
#include <rfb/Logger_syslog.h>
|
#include <rfb/Logger_syslog.h>
|
||||||
|
#include <rfb/ServerCore.h>
|
||||||
|
|
||||||
#include "RFBGlue.h"
|
#include "RFBGlue.h"
|
||||||
|
|
||||||
@ -89,6 +90,20 @@ void vncLogDebug(const char *name, const char *format, ...)
|
|||||||
va_end(ap);
|
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)
|
int vncSetParam(const char *name, const char *value)
|
||||||
{
|
{
|
||||||
if (value != NULL)
|
if (value != NULL)
|
||||||
|
@ -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 vncLogStatus(const char *name, const char *format, ...) __printf_attr(2, 3);
|
||||||
void vncLogInfo(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 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 vncSetParam(const char *name, const char *value);
|
||||||
int vncSetParamSimple(const char *nameAndValue);
|
int vncSetParamSimple(const char *nameAndValue);
|
||||||
|
Loading…
Reference in New Issue
Block a user