]> source.dussan.org Git - tigervnc.git/commitdiff
[Development] winvnc: Enable debug output when built with -D_DEBUG
authorAdam Tkac <atkac@redhat.com>
Wed, 26 Jan 2011 19:09:03 +0000 (19:09 +0000)
committerAdam Tkac <atkac@redhat.com>
Wed, 26 Jan 2011 19:09:03 +0000 (19:09 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4242 3789f03b-4d11-0410-bbf8-ca57d06f2519

win/winvnc/winvnc.cxx

index b16fb601ba52630b13c2c112e78407b8001b53e5..1df0f769b97d2f32e1184e47b58b01559903cab0 100644 (file)
@@ -224,15 +224,25 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prevInst, char* cmdLine, int cmdSho
   try {
     // - Initialise the available loggers
     //freopen("\\\\drupe\\tjr\\WinVNC4.log","ab",stderr);
-    //setbuf(stderr, 0);
-    initStdIOLoggers();
+#ifdef _DEBUG
+    AllocConsole();
+       freopen("CONIN$", "rb", stdin);
+       freopen("CONOUT$", "wb", stdout);
+       freopen("CONOUT$", "wb", stderr);
+    setbuf(stderr, 0);
+       initStdIOLoggers();
+       initFileLogger("C:\\temp\\WinVNC4.log");
+       logParams.setParam("*:stderr:100");
+#else
     initFileLogger("C:\\temp\\WinVNC4.log");
+       logParams.setParam("*:stderr:0");
+#endif
     rfb::win32::initEventLogLogger(VNCServerService::Name);
 
        Configuration::enableServerParams();
 
     // - By default, just log errors to stderr
-    logParams.setParam("*:stderr:0");
+    
 
     // - Print program details and process the command line
     programInfo();