aboutsummaryrefslogtreecommitdiffstats
path: root/common/rfb/Region.cxx
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2016-04-20 09:38:06 +0200
committerPierre Ossman <ossman@cendio.se>2019-04-29 14:14:00 +0200
commite9e7da9b7adcf33dece522514c323d392913041b (patch)
tree1c179f451b8ecd43bad1bef5543dfe2c81b2f488 /common/rfb/Region.cxx
parent0fb3e3519558531a64f345726e414998f7d9dc5a (diff)
downloadtigervnc-e9e7da9b7adcf33dece522514c323d392913041b.tar.gz
tigervnc-e9e7da9b7adcf33dece522514c323d392913041b.zip
Do proper logging rather than fprintf(stderr, ...)
Diffstat (limited to 'common/rfb/Region.cxx')
-rw-r--r--common/rfb/Region.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/common/rfb/Region.cxx b/common/rfb/Region.cxx
index c17c5d48..beca482d 100644
--- a/common/rfb/Region.cxx
+++ b/common/rfb/Region.cxx
@@ -24,6 +24,7 @@
//
#include <rfb/Region.h>
+#include <rfb/LogWriter.h>
#include <assert.h>
#include <stdio.h>
@@ -33,6 +34,8 @@ extern "C" {
#include <Xregion/Xregion.h>
}
+static rfb::LogWriter vlog("Region");
+
// A _RectRegion must never be passed as a return parameter to the Xlib region
// operations. This is because for efficiency its "rects" member has not been
// allocated with Xmalloc. It is however safe to pass it as an input
@@ -123,7 +126,7 @@ void rfb::Region::setExtentsAndOrderedRects(const ShortRect* extents,
BOX* prevRects = xrgn->rects;
xrgn->rects = (BOX*)Xrealloc((char*)xrgn->rects, nRects * sizeof(BOX));
if (!xrgn->rects) {
- fprintf(stderr,"Xrealloc failed\n");
+ vlog.error("Xrealloc failed");
Xfree(prevRects);
return;
}
@@ -234,13 +237,13 @@ rfb::Rect rfb::Region::get_bounding_rect() const {
void rfb::Region::debug_print(const char* prefix) const
{
- fprintf(stderr,"%s num rects %3ld extents %3d,%3d %3dx%3d\n",
+ vlog.debug("%s num rects %3ld extents %3d,%3d %3dx%3d",
prefix, xrgn->numRects, xrgn->extents.x1, xrgn->extents.y1,
xrgn->extents.x2-xrgn->extents.x1,
xrgn->extents.y2-xrgn->extents.y1);
for (int i = 0; i < xrgn->numRects; i++) {
- fprintf(stderr," rect %3d,%3d %3dx%3d\n",
+ vlog.debug(" rect %3d,%3d %3dx%3d",
xrgn->rects[i].x1, xrgn->rects[i].y1,
xrgn->rects[i].x2-xrgn->rects[i].x1,
xrgn->rects[i].y2-xrgn->rects[i].y1);