[Box Backup-commit] COMMIT r2092 - in box/trunk/lib: common server

boxbackup-dev at fluffy.co.uk boxbackup-dev at fluffy.co.uk
Fri Feb 22 00:43:17 GMT 2008


Author: chris
Date: 2008-02-22 00:43:16 +0000 (Fri, 22 Feb 2008)
New Revision: 2092

Modified:
   box/trunk/lib/common/Logging.cpp
   box/trunk/lib/common/Logging.h
   box/trunk/lib/server/Daemon.cpp
Log:
Disable -P option and showing PID in Logging on Windows.


Modified: box/trunk/lib/common/Logging.cpp
===================================================================
--- box/trunk/lib/common/Logging.cpp	2008-02-12 13:39:07 UTC (rev 2091)
+++ box/trunk/lib/common/Logging.cpp	2008-02-22 00:43:16 UTC (rev 2092)
@@ -182,7 +182,9 @@
 bool Console::sShowTime = false;
 bool Console::sShowTimeMicros = false;
 bool Console::sShowTag = false;
+#ifndef WIN32
 bool Console::sShowPID = false;
+#endif
 std::string Console::sTag;
 
 void Console::SetTag(const std::string& rTag)
@@ -201,10 +203,12 @@
 	sShowTimeMicros = enabled;
 }
 
+#ifndef WIN32
 void Console::SetShowPID(bool enabled)
 {
 	sShowPID = enabled;
 }
+#endif
 
 bool Console::Log(Log::Level level, const std::string& rFile, 
 	int line, std::string& rMessage)
@@ -258,19 +262,23 @@
 
 	if (sShowTag)
 	{
+		#ifndef WIN32
 		if (sShowPID)
 		{
 			buf << "[" << sTag << " " << getpid() << "] ";
 		}
 		else
+		#endif
 		{
 			buf << "[" << sTag << "] ";
 		}
 	}
+	#ifndef WIN32
 	else if (sShowPID)
 	{
 		buf << "[" << getpid() << "] ";
 	}
+	#endif
 
 	if (level <= Log::FATAL)
 	{

Modified: box/trunk/lib/common/Logging.h
===================================================================
--- box/trunk/lib/common/Logging.h	2008-02-12 13:39:07 UTC (rev 2091)
+++ box/trunk/lib/common/Logging.h	2008-02-22 00:43:16 UTC (rev 2092)
@@ -121,7 +121,9 @@
 	static bool sShowTimeMicros;
 	static bool sShowTag;
 	static std::string sTag;
+	#ifndef WIN32
 	static bool sShowPID;
+	#endif
 
 	public:
 	virtual bool Log(Log::Level level, const std::string& rFile, 
@@ -132,7 +134,9 @@
 	static void SetTag(const std::string& rTag);
 	static void SetShowTime(bool enabled);
 	static void SetShowTimeMicros(bool enabled);
+	#ifndef WIN32
 	static void SetShowPID(bool enabled);
+	#endif
 };
 
 // --------------------------------------------------------------------------

Modified: box/trunk/lib/server/Daemon.cpp
===================================================================
--- box/trunk/lib/server/Daemon.cpp	2008-02-12 13:39:07 UTC (rev 2091)
+++ box/trunk/lib/server/Daemon.cpp	2008-02-22 00:43:16 UTC (rev 2092)
@@ -104,9 +104,9 @@
 {
 	return "c:"
 	#ifndef WIN32
-		"DFk"
+		"DFkP"
 	#endif
-		"hPqvVt:TU";
+		"hqvVt:TU";
 }
 
 void Daemon::Usage()
@@ -124,8 +124,8 @@
 	"  -D         Debugging mode, do not fork, one process only, one client only\n"
 	"  -F         Do not fork into background, but fork to serve multiple clients\n"
 	"  -k         Keep console open after fork, keep writing log messages to it\n"
+	"  -P         Show process ID (PID) in console output\n"
 #endif
-	"  -P         Show process ID (PID) in console output\n"
 	"  -q         Run more quietly, reduce verbosity level by one, can repeat\n"
 	"  -v         Run more verbosely, increase verbosity level by one, can repeat\n"
 	"  -V         Run at maximum verbosity\n"
@@ -183,11 +183,13 @@
 		}
 		break;
 
+		#ifndef WIN32
 		case 'P':
 		{
 			Console::SetShowPID(true);
 		}
 		break;
+		#endif
 
 		case 'q':
 		{




More information about the Boxbackup-commit mailing list