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 /unix | |
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 'unix')
-rw-r--r-- | unix/common/CMakeLists.txt | 1 | ||||
-rw-r--r-- | unix/common/randr.cxx | 8 | ||||
-rw-r--r-- | unix/vncconfig/vncconfig.cxx | 11 | ||||
-rw-r--r-- | unix/x0vncserver/Geometry.cxx | 7 | ||||
-rw-r--r-- | unix/x0vncserver/Image.cxx | 5 | ||||
-rw-r--r-- | unix/x0vncserver/PollingManager.cxx | 4 | ||||
-rw-r--r-- | unix/x0vncserver/XDesktop.cxx | 5 | ||||
-rw-r--r-- | unix/x0vncserver/XSelection.cxx | 5 | ||||
-rw-r--r-- | unix/x0vncserver/x0vncserver.cxx | 10 | ||||
-rw-r--r-- | unix/xserver/hw/vnc/RFBGlue.cc | 35 | ||||
-rw-r--r-- | unix/xserver/hw/vnc/XserverDesktop.cc | 4 | ||||
-rw-r--r-- | unix/xserver/hw/vnc/vncExtInit.cc | 9 |
12 files changed, 52 insertions, 52 deletions
diff --git a/unix/common/CMakeLists.txt b/unix/common/CMakeLists.txt index 87e2ae79..72662fdb 100644 --- a/unix/common/CMakeLists.txt +++ b/unix/common/CMakeLists.txt @@ -3,6 +3,7 @@ add_library(unixcommon STATIC target_include_directories(unixcommon PUBLIC ${CMAKE_SOURCE_DIR}/common) target_include_directories(unixcommon PUBLIC ${CMAKE_SOURCE_DIR}/unix/common) +target_link_libraries(unixcommon core rfb) if(UNIX) libtool_create_control_file(unixcommon) diff --git a/unix/common/randr.cxx b/unix/common/randr.cxx index eedfd811..7f38f3c0 100644 --- a/unix/common/randr.cxx +++ b/unix/common/randr.cxx @@ -26,11 +26,15 @@ #include <stdlib.h> #include <unixcommon.h> + +#include <core/LogWriter.h> + #include <rfb/screenTypes.h> -#include <rfb/LogWriter.h> #include <rfb/ScreenSet.h> + #include <RandrGlue.h> -static rfb::LogWriter vlog("RandR"); + +static core::LogWriter vlog("RandR"); static int ResizeScreen(bool dryrun, int fb_width, int fb_height, std::set<unsigned int>* disabledOutputs) diff --git a/unix/vncconfig/vncconfig.cxx b/unix/vncconfig/vncconfig.cxx index 5e4791a5..51d444c3 100644 --- a/unix/vncconfig/vncconfig.cxx +++ b/unix/vncconfig/vncconfig.cxx @@ -42,9 +42,8 @@ #include <core/Configuration.h> #include <core/Exception.h> - -#include <rfb/Logger_stdio.h> -#include <rfb/LogWriter.h> +#include <core/Logger_stdio.h> +#include <core/LogWriter.h> #include "TXWindow.h" #include "TXCheckbox.h" @@ -53,7 +52,7 @@ using namespace rfb; -static LogWriter vlog("vncconfig"); +static core::LogWriter vlog("vncconfig"); core::StringParameter displayname("display", "The X display", ""); core::BoolParameter noWindow("nowin", "Don't display a window", 0); @@ -210,8 +209,8 @@ void removeArgs(int* argc, char** argv, int first, int n) int main(int argc, char** argv) { programName = argv[0]; - rfb::initStdIOLoggers(); - rfb::LogWriter::setLogParams("*:stderr:30"); + core::initStdIOLoggers(); + core::LogWriter::setLogParams("*:stderr:30"); // Process vncconfig's own parameters first, then we process the // other arguments when we have the X display. diff --git a/unix/x0vncserver/Geometry.cxx b/unix/x0vncserver/Geometry.cxx index 0aa20bd0..0a848cbb 100644 --- a/unix/x0vncserver/Geometry.cxx +++ b/unix/x0vncserver/Geometry.cxx @@ -26,12 +26,11 @@ #include <string.h> -#include <rfb/LogWriter.h> -#include <x0vncserver/Geometry.h> +#include <core/LogWriter.h> -using namespace rfb; +#include <x0vncserver/Geometry.h> -static LogWriter vlog("Geometry"); +static core::LogWriter vlog("Geometry"); core::StringParameter Geometry::m_geometryParam("Geometry", "Screen area shown to VNC clients. " diff --git a/unix/x0vncserver/Image.cxx b/unix/x0vncserver/Image.cxx index bd48c88d..88467c61 100644 --- a/unix/x0vncserver/Image.cxx +++ b/unix/x0vncserver/Image.cxx @@ -32,7 +32,8 @@ #include <sys/ipc.h> #include <sys/shm.h> -#include <rfb/LogWriter.h> +#include <core/LogWriter.h> + #include <x0vncserver/Image.h> // @@ -60,7 +61,7 @@ ImageCleanup imageCleanup; // Image class implementation. // -static rfb::LogWriter vlog("Image"); +static core::LogWriter vlog("Image"); Image::Image(Display *d) : xim(nullptr), dpy(d) diff --git a/unix/x0vncserver/PollingManager.cxx b/unix/x0vncserver/PollingManager.cxx index 02fc8647..e0bf4fbf 100644 --- a/unix/x0vncserver/PollingManager.cxx +++ b/unix/x0vncserver/PollingManager.cxx @@ -31,8 +31,8 @@ #include <X11/Xlib.h> #include <core/Configuration.h> +#include <core/LogWriter.h> -#include <rfb/LogWriter.h> #include <rfb/VNCServer.h> #include <rfb/ServerCore.h> @@ -40,7 +40,7 @@ using namespace rfb; -static LogWriter vlog("PollingMgr"); +static core::LogWriter vlog("PollingMgr"); const int PollingManager::m_pollingOrder[32] = { 0, 16, 8, 24, 4, 20, 12, 28, diff --git a/unix/x0vncserver/XDesktop.cxx b/unix/x0vncserver/XDesktop.cxx index 4dde3fb3..dc87015e 100644 --- a/unix/x0vncserver/XDesktop.cxx +++ b/unix/x0vncserver/XDesktop.cxx @@ -28,9 +28,10 @@ #include <algorithm> +#include <core/LogWriter.h> + #include <network/Socket.h> -#include <rfb/LogWriter.h> #include <rfb/ScreenSet.h> #include <x0vncserver/XDesktop.h> @@ -79,7 +80,7 @@ core::IntParameter "connection", 10); -static rfb::LogWriter vlog("XDesktop"); +static core::LogWriter vlog("XDesktop"); // order is important as it must match RFB extension static const char * ledNames[XDESKTOP_N_LEDS] = { diff --git a/unix/x0vncserver/XSelection.cxx b/unix/x0vncserver/XSelection.cxx index dcc674a0..95c91fbc 100644 --- a/unix/x0vncserver/XSelection.cxx +++ b/unix/x0vncserver/XSelection.cxx @@ -19,10 +19,9 @@ #include <X11/Xatom.h> #include <core/Configuration.h> +#include <core/LogWriter.h> #include <core/util.h> -#include <rfb/LogWriter.h> - #include <x0vncserver/XSelection.h> core::BoolParameter @@ -34,7 +33,7 @@ core::BoolParameter "Send the PRIMARY as well as the CLIPBOARD selection", true); -static rfb::LogWriter vlog("XSelection"); +static core::LogWriter vlog("XSelection"); XSelection::XSelection(Display* dpy_, XSelectionHandler* handler_) : TXWindow(dpy_, 1, 1, nullptr), handler(handler_), announcedSelection(None) diff --git a/unix/x0vncserver/x0vncserver.cxx b/unix/x0vncserver/x0vncserver.cxx index 7ee70575..b6e33014 100644 --- a/unix/x0vncserver/x0vncserver.cxx +++ b/unix/x0vncserver/x0vncserver.cxx @@ -32,11 +32,11 @@ #include <pwd.h> #include <core/Configuration.h> +#include <core/Logger_stdio.h> +#include <core/LogWriter.h> #include <rdr/FdOutStream.h> -#include <rfb/Logger_stdio.h> -#include <rfb/LogWriter.h> #include <rfb/VNCServerST.h> #include <rfb/Timer.h> @@ -62,7 +62,7 @@ extern char buildtime[]; using namespace rfb; using namespace network; -static LogWriter vlog("Main"); +static core::LogWriter vlog("Main"); static const char* defaultDesktopName(); @@ -289,8 +289,8 @@ static void usage() int main(int argc, char** argv) { - initStdIOLoggers(); - LogWriter::setLogParams("*:stderr:30"); + core::initStdIOLoggers(); + core::LogWriter::setLogParams("*:stderr:30"); programName = argv[0]; Display* dpy; diff --git a/unix/xserver/hw/vnc/RFBGlue.cc b/unix/xserver/hw/vnc/RFBGlue.cc index 94c7ad57..5aa24c1d 100644 --- a/unix/xserver/hw/vnc/RFBGlue.cc +++ b/unix/xserver/hw/vnc/RFBGlue.cc @@ -25,34 +25,31 @@ #include <string.h> #include <core/Configuration.h> +#include <core/Logger_stdio.h> +#include <core/Logger_syslog.h> +#include <core/LogWriter.h> #include <core/util.h> #include <network/TcpSocket.h> -#include <rfb/LogWriter.h> -#include <rfb/Logger_stdio.h> -#include <rfb/Logger_syslog.h> - #include "RFBGlue.h" -using namespace rfb; - // Loggers used by C code must be created here -static LogWriter inputLog("Input"); -static LogWriter selectionLog("Selection"); +static core::LogWriter inputLog("Input"); +static core::LogWriter selectionLog("Selection"); void vncInitRFB(void) { - rfb::initStdIOLoggers(); - rfb::initSyslogLogger(); - rfb::LogWriter::setLogParams("*:stderr:30"); + core::initStdIOLoggers(); + core::initSyslogLogger(); + core::LogWriter::setLogParams("*:stderr:30"); } void vncLogError(const char *name, const char *format, ...) { - LogWriter *vlog; + core::LogWriter* vlog; va_list ap; - vlog = LogWriter::getLogWriter(name); + vlog = core::LogWriter::getLogWriter(name); if (vlog == nullptr) return; va_start(ap, format); @@ -62,9 +59,9 @@ void vncLogError(const char *name, const char *format, ...) void vncLogStatus(const char *name, const char *format, ...) { - LogWriter *vlog; + core::LogWriter* vlog; va_list ap; - vlog = LogWriter::getLogWriter(name); + vlog = core::LogWriter::getLogWriter(name); if (vlog == nullptr) return; va_start(ap, format); @@ -74,9 +71,9 @@ void vncLogStatus(const char *name, const char *format, ...) void vncLogInfo(const char *name, const char *format, ...) { - LogWriter *vlog; + core::LogWriter* vlog; va_list ap; - vlog = LogWriter::getLogWriter(name); + vlog = core::LogWriter::getLogWriter(name); if (vlog == nullptr) return; va_start(ap, format); @@ -86,9 +83,9 @@ void vncLogInfo(const char *name, const char *format, ...) void vncLogDebug(const char *name, const char *format, ...) { - LogWriter *vlog; + core::LogWriter* vlog; va_list ap; - vlog = LogWriter::getLogWriter(name); + vlog = core::LogWriter::getLogWriter(name); if (vlog == nullptr) return; va_start(ap, format); diff --git a/unix/xserver/hw/vnc/XserverDesktop.cc b/unix/xserver/hw/vnc/XserverDesktop.cc index 6f3e832f..de6c0c94 100644 --- a/unix/xserver/hw/vnc/XserverDesktop.cc +++ b/unix/xserver/hw/vnc/XserverDesktop.cc @@ -38,13 +38,13 @@ #include <sys/utsname.h> #include <core/Configuration.h> +#include <core/LogWriter.h> #include <rdr/FdOutStream.h> #include <network/Socket.h> #include <rfb/VNCServerST.h> -#include <rfb/LogWriter.h> #include <rfb/ServerCore.h> #include "XserverDesktop.h" @@ -63,7 +63,7 @@ void vncPresentMscEvent(uint64_t id, uint64_t msc); using namespace rfb; using namespace network; -static LogWriter vlog("XserverDesktop"); +static core::LogWriter vlog("XserverDesktop"); core::BoolParameter rawKeyboard("RawKeyboard", diff --git a/unix/xserver/hw/vnc/vncExtInit.cc b/unix/xserver/hw/vnc/vncExtInit.cc index c338fabc..7a5e04df 100644 --- a/unix/xserver/hw/vnc/vncExtInit.cc +++ b/unix/xserver/hw/vnc/vncExtInit.cc @@ -31,13 +31,12 @@ #include <string> #include <core/Configuration.h> +#include <core/Logger_stdio.h> +#include <core/LogWriter.h> #include <core/Region.h> -#include <rfb/Logger_stdio.h> -#include <rfb/LogWriter.h> #include <rfb/ServerCore.h> #include <rdr/HexOutStream.h> -#include <rfb/LogWriter.h> #include <rfb/ledStates.h> #include <network/TcpSocket.h> @@ -58,7 +57,7 @@ void vncSetGlueContext(int screenIndex); using namespace rfb; -static rfb::LogWriter vlog("vncext"); +static core::LogWriter vlog("vncext"); // We can't safely get this from Xorg #define MAXSCREENS 16 @@ -202,7 +201,7 @@ void vncExtensionInit(void) try { if (!initialised) { - rfb::initStdIOLoggers(); + core::initStdIOLoggers(); parseOverrideList(allowOverride, allowOverrideSet); allowOverride.setImmutable(); |