diff options
author | Pierre Ossman <ossman@cendio.se> | 2024-11-19 15:56:22 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2025-02-25 16:58:29 +0100 |
commit | 8638c42cbe8e63ae4a90fee7de0436c4cf6eece2 (patch) | |
tree | e84268eb10de33827362308ccd3124865c81466e /vncviewer | |
parent | cf1bc662e42cfd91bcd82138c0ca5211b1ac75c7 (diff) | |
download | tigervnc-8638c42cbe8e63ae4a90fee7de0436c4cf6eece2.tar.gz tigervnc-8638c42cbe8e63ae4a90fee7de0436c4cf6eece2.zip |
Move logging to core library
Make it clearer what is protocol handling and what is just general
plumbing.
This is one step of several.
Diffstat (limited to 'vncviewer')
-rw-r--r-- | vncviewer/CConn.cxx | 4 | ||||
-rw-r--r-- | vncviewer/DesktopWindow.cxx | 6 | ||||
-rw-r--r-- | vncviewer/GestureHandler.cxx | 4 | ||||
-rw-r--r-- | vncviewer/KeyboardMacOS.mm | 5 | ||||
-rw-r--r-- | vncviewer/KeyboardWin32.cxx | 5 | ||||
-rw-r--r-- | vncviewer/KeyboardX11.cxx | 5 | ||||
-rw-r--r-- | vncviewer/MonitorIndicesParameter.cxx | 7 | ||||
-rw-r--r-- | vncviewer/PlatformPixelBuffer.cxx | 4 | ||||
-rw-r--r-- | vncviewer/ServerDialog.cxx | 6 | ||||
-rw-r--r-- | vncviewer/Viewport.cxx | 4 | ||||
-rw-r--r-- | vncviewer/Win32TouchHandler.cxx | 5 | ||||
-rw-r--r-- | vncviewer/XInputTouchHandler.cxx | 5 | ||||
-rw-r--r-- | vncviewer/parameters.cxx | 4 | ||||
-rw-r--r-- | vncviewer/touch.cxx | 4 | ||||
-rw-r--r-- | vncviewer/vncviewer.cxx | 14 |
15 files changed, 43 insertions, 39 deletions
diff --git a/vncviewer/CConn.cxx b/vncviewer/CConn.cxx index 42eeee40..e91f1972 100644 --- a/vncviewer/CConn.cxx +++ b/vncviewer/CConn.cxx @@ -27,6 +27,7 @@ #include <unistd.h> #endif +#include <core/LogWriter.h> #include <core/util.h> #include <rdr/FdInStream.h> @@ -35,7 +36,6 @@ #include <rfb/CMsgWriter.h> #include <rfb/CSecurity.h> #include <rfb/Exception.h> -#include <rfb/LogWriter.h> #include <rfb/Security.h> #include <rfb/fenceTypes.h> #include <rfb/Timer.h> @@ -63,7 +63,7 @@ using namespace rfb; -static rfb::LogWriter vlog("CConn"); +static core::LogWriter vlog("CConn"); // 8 colours (1 bit per component) static const PixelFormat verylowColourPF(8, 3,false, true, diff --git a/vncviewer/DesktopWindow.cxx b/vncviewer/DesktopWindow.cxx index af66f245..5e468e1d 100644 --- a/vncviewer/DesktopWindow.cxx +++ b/vncviewer/DesktopWindow.cxx @@ -28,9 +28,9 @@ #include <string.h> #include <sys/time.h> +#include <core/LogWriter.h> #include <core/util.h> -#include <rfb/LogWriter.h> #include <rfb/CMsgWriter.h> #include <rfb/ScreenSet.h> @@ -74,7 +74,7 @@ static int edge_scroll_size_y = 96; using namespace rfb; -static rfb::LogWriter vlog("DesktopWindow"); +static core::LogWriter vlog("DesktopWindow"); // Global due to http://www.fltk.org/str.php?L2177 and the similar // issue for Fl::event_dispatch. @@ -225,7 +225,7 @@ DesktopWindow::DesktopWindow(int w, int h, const char *name, repositionWidgets(); // Throughput graph for debugging - if (vlog.getLevel() >= LogWriter::LEVEL_DEBUG) { + if (vlog.getLevel() >= core::LogWriter::LEVEL_DEBUG) { memset(&stats, 0, sizeof(stats)); Fl::add_timeout(0, handleStatsTimeout, this); } diff --git a/vncviewer/GestureHandler.cxx b/vncviewer/GestureHandler.cxx index bd01b3cd..464386a5 100644 --- a/vncviewer/GestureHandler.cxx +++ b/vncviewer/GestureHandler.cxx @@ -24,12 +24,12 @@ #include <assert.h> #include <math.h> +#include <core/LogWriter.h> #include <core/util.h> -#include <rfb/LogWriter.h> #include "GestureHandler.h" -static rfb::LogWriter vlog("GestureHandler"); +static core::LogWriter vlog("GestureHandler"); static const unsigned char GH_NOGESTURE = 0; static const unsigned char GH_ONETAP = 1; diff --git a/vncviewer/KeyboardMacOS.mm b/vncviewer/KeyboardMacOS.mm index e0a10dc8..9ef2fc93 100644 --- a/vncviewer/KeyboardMacOS.mm +++ b/vncviewer/KeyboardMacOS.mm @@ -35,11 +35,12 @@ const int kVK_RightCommand = 0x36; // And this is still missing const int kVK_Menu = 0x6E; +#include <core/LogWriter.h> + #define XK_LATIN1 #define XK_MISCELLANY #include <rfb/keysymdef.h> #include <rfb/XF86keysym.h> -#include <rfb/LogWriter.h> #include <rfb/ledStates.h> #define NoSymbol 0 @@ -51,7 +52,7 @@ const int kVK_Menu = 0x6E; extern const unsigned short code_map_osx_to_qnum[]; extern const unsigned int code_map_osx_to_qnum_len; -static rfb::LogWriter vlog("KeyboardMacOS"); +static core::LogWriter vlog("KeyboardMacOS"); static const int kvk_map[][2] = { { kVK_Return, XK_Return }, diff --git a/vncviewer/KeyboardWin32.cxx b/vncviewer/KeyboardWin32.cxx index 1caf4863..76286217 100644 --- a/vncviewer/KeyboardWin32.cxx +++ b/vncviewer/KeyboardWin32.cxx @@ -31,12 +31,13 @@ #include <FL/Fl.H> +#include <core/LogWriter.h> + #define XK_MISCELLANY #define XK_XKB_KEYS #define XK_KOREAN #include <rfb/keysymdef.h> #include <rfb/XF86keysym.h> -#include <rfb/LogWriter.h> #include <rfb/ledStates.h> #define NoSymbol 0 @@ -50,7 +51,7 @@ // Used to detect fake input (0xaa is not a real key) static const WORD SCAN_FAKE = 0xaa; -static rfb::LogWriter vlog("KeyboardWin32"); +static core::LogWriter vlog("KeyboardWin32"); // Layout independent keys static const UINT vkey_map[][3] = { diff --git a/vncviewer/KeyboardX11.cxx b/vncviewer/KeyboardX11.cxx index 0ee1d4f6..973278fc 100644 --- a/vncviewer/KeyboardX11.cxx +++ b/vncviewer/KeyboardX11.cxx @@ -27,7 +27,8 @@ #include <X11/XKBlib.h> #include <FL/x.H> -#include <rfb/LogWriter.h> +#include <core/LogWriter.h> + #include <rfb/ledStates.h> #include "i18n.h" @@ -39,7 +40,7 @@ extern const struct _code_map_xkb_to_qnum { } code_map_xkb_to_qnum[]; extern const unsigned int code_map_xkb_to_qnum_len; -static rfb::LogWriter vlog("KeyboardX11"); +static core::LogWriter vlog("KeyboardX11"); KeyboardX11::KeyboardX11(KeyboardHandler* handler_) : Keyboard(handler_) diff --git a/vncviewer/MonitorIndicesParameter.cxx b/vncviewer/MonitorIndicesParameter.cxx index 957ade06..1e2efdbc 100644 --- a/vncviewer/MonitorIndicesParameter.cxx +++ b/vncviewer/MonitorIndicesParameter.cxx @@ -30,13 +30,14 @@ #include <stdexcept> #include "i18n.h" + #include <FL/Fl.H> -#include <rfb/LogWriter.h> + +#include <core/LogWriter.h> #include "MonitorIndicesParameter.h" -using namespace rfb; -static LogWriter vlog("MonitorIndicesParameter"); +static core::LogWriter vlog("MonitorIndicesParameter"); MonitorIndicesParameter::MonitorIndicesParameter(const char* name_, const char* desc_, const char* v) : StringParameter(name_, desc_, v) {} diff --git a/vncviewer/PlatformPixelBuffer.cxx b/vncviewer/PlatformPixelBuffer.cxx index 2641cd0c..6a6d22f1 100644 --- a/vncviewer/PlatformPixelBuffer.cxx +++ b/vncviewer/PlatformPixelBuffer.cxx @@ -33,11 +33,11 @@ #include <FL/Fl.H> #include <FL/x.H> -#include <rfb/LogWriter.h> +#include <core/LogWriter.h> #include "PlatformPixelBuffer.h" -static rfb::LogWriter vlog("PlatformPixelBuffer"); +static core::LogWriter vlog("PlatformPixelBuffer"); PlatformPixelBuffer::PlatformPixelBuffer(int width, int height) : FullFramePixelBuffer(rfb::PixelFormat(32, 24, false, true, diff --git a/vncviewer/ServerDialog.cxx b/vncviewer/ServerDialog.cxx index c2c3e8ce..9f60412b 100644 --- a/vncviewer/ServerDialog.cxx +++ b/vncviewer/ServerDialog.cxx @@ -41,14 +41,13 @@ #include <FL/Fl_File_Chooser.H> #include <core/Exception.h> +#include <core/LogWriter.h> #include <core/util.h> #include <os/os.h> #include <network/TcpSocket.h> -#include <rfb/LogWriter.h> - #include "fltk/layout.h" #include "fltk/util.h" #include "ServerDialog.h" @@ -59,9 +58,8 @@ using namespace std; -using namespace rfb; -static LogWriter vlog("ServerDialog"); +static core::LogWriter vlog("ServerDialog"); const char* SERVER_HISTORY="tigervnc.history"; diff --git a/vncviewer/Viewport.cxx b/vncviewer/Viewport.cxx index 1924f458..f8291dcb 100644 --- a/vncviewer/Viewport.cxx +++ b/vncviewer/Viewport.cxx @@ -27,10 +27,10 @@ #include <stdexcept> +#include <core/LogWriter.h> #include <core/util.h> #include <rfb/CMsgWriter.h> -#include <rfb/LogWriter.h> #include <rfb/ledStates.h> // FLTK can pull in the X11 headers on some systems @@ -73,7 +73,7 @@ using namespace rfb; -static rfb::LogWriter vlog("Viewport"); +static core::LogWriter vlog("Viewport"); // Menu constants diff --git a/vncviewer/Win32TouchHandler.cxx b/vncviewer/Win32TouchHandler.cxx index 2be27ede..d1d81ae1 100644 --- a/vncviewer/Win32TouchHandler.cxx +++ b/vncviewer/Win32TouchHandler.cxx @@ -24,14 +24,15 @@ #include <stdexcept> +#include <core/LogWriter.h> + #define XK_MISCELLANY #include <rfb/keysymdef.h> -#include <rfb/LogWriter.h> #include "i18n.h" #include "Win32TouchHandler.h" -static rfb::LogWriter vlog("Win32TouchHandler"); +static core::LogWriter vlog("Win32TouchHandler"); static const DWORD MOUSEMOVE_FLAGS = MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_VIRTUALDESK; diff --git a/vncviewer/XInputTouchHandler.cxx b/vncviewer/XInputTouchHandler.cxx index 2b2e02c6..545a097e 100644 --- a/vncviewer/XInputTouchHandler.cxx +++ b/vncviewer/XInputTouchHandler.cxx @@ -30,16 +30,17 @@ #include <FL/x.H> +#include <core/LogWriter.h> + #ifndef XK_MISCELLANY #define XK_MISCELLANY #include <rfb/keysymdef.h> #endif -#include <rfb/LogWriter.h> #include "i18n.h" #include "XInputTouchHandler.h" -static rfb::LogWriter vlog("XInputTouchHandler"); +static core::LogWriter vlog("XInputTouchHandler"); static bool grabbed = false; diff --git a/vncviewer/parameters.cxx b/vncviewer/parameters.cxx index ce402785..ba31b495 100644 --- a/vncviewer/parameters.cxx +++ b/vncviewer/parameters.cxx @@ -33,11 +33,11 @@ #include "parameters.h" #include <core/Exception.h> +#include <core/LogWriter.h> #include <core/util.h> #include <os/os.h> -#include <rfb/LogWriter.h> #include <rfb/SecurityClient.h> #include <FL/fl_utf8.h> @@ -53,7 +53,7 @@ using namespace rfb; using namespace std; -static LogWriter vlog("Parameters"); +static core::LogWriter vlog("Parameters"); core::IntParameter pointerEventInterval("PointerEventInterval", diff --git a/vncviewer/touch.cxx b/vncviewer/touch.cxx index 572e726e..8b998425 100644 --- a/vncviewer/touch.cxx +++ b/vncviewer/touch.cxx @@ -36,7 +36,7 @@ #include <FL/Fl.H> #include <FL/x.H> -#include <rfb/LogWriter.h> +#include <core/LogWriter.h> #include "i18n.h" #include "vncviewer.h" @@ -49,7 +49,7 @@ #include "touch.h" -static rfb::LogWriter vlog("Touch"); +static core::LogWriter vlog("Touch"); #if !defined(WIN32) && !defined(__APPLE__) static int xi_major; diff --git a/vncviewer/vncviewer.cxx b/vncviewer/vncviewer.cxx index db4c43b9..a82efe89 100644 --- a/vncviewer/vncviewer.cxx +++ b/vncviewer/vncviewer.cxx @@ -49,12 +49,12 @@ #endif #include <core/Exception.h> +#include <core/Logger_stdio.h> +#include <core/LogWriter.h> -#include <rfb/Logger_stdio.h> #ifdef HAVE_GNUTLS #include <rfb/CSecurityTLS.h> #endif -#include <rfb/LogWriter.h> #include <rfb/Timer.h> #include <network/TcpSocket.h> @@ -81,7 +81,7 @@ #include "win32.h" #endif -static rfb::LogWriter vlog("main"); +static core::LogWriter vlog("main"); using namespace network; using namespace rfb; @@ -653,13 +653,13 @@ int main(int argc, char** argv) bind_textdomain_codeset(PACKAGE_NAME, "UTF-8"); bind_textdomain_codeset("libc", "UTF-8"); - rfb::initStdIOLoggers(); + core::initStdIOLoggers(); #ifdef WIN32 - rfb::initFileLogger("C:\\temp\\vncviewer.log"); + core::initFileLogger("C:\\temp\\vncviewer.log"); #else - rfb::initFileLogger("/tmp/vncviewer.log"); + core::initFileLogger("/tmp/vncviewer.log"); #endif - rfb::LogWriter::setLogParams("*:stderr:30"); + core::LogWriter::setLogParams("*:stderr:30"); #ifdef SIGHUP signal(SIGHUP, CleanupSignalHandler); |