[Box Backup-commit] COMMIT r1324 - box/chris/general/bin/bbackupd

boxbackup-dev at fluffy.co.uk boxbackup-dev at fluffy.co.uk
Sat Mar 3 21:53:51 GMT 2007


Author: chris
Date: 2007-03-03 21:53:50 +0000 (Sat, 03 Mar 2007)
New Revision: 1324

Modified:
   box/chris/general/bin/bbackupd/bbackupd.cpp
Log:
Port to new logging framework (from chris/merge)


Modified: box/chris/general/bin/bbackupd/bbackupd.cpp
===================================================================
--- box/chris/general/bin/bbackupd/bbackupd.cpp	2007-03-03 21:48:18 UTC (rev 1323)
+++ box/chris/general/bin/bbackupd/bbackupd.cpp	2007-03-03 21:53:50 UTC (rev 1324)
@@ -12,6 +12,7 @@
 #include "MainHelper.h"
 #include "BoxPortsAndFiles.h"
 #include "BackupStoreException.h"
+#include "Logging.h"
 
 #include "MemLeakFindOn.h"
 
@@ -26,10 +27,12 @@
 {
 	MAINHELPER_START
 
+	Logging::SetProgramName("Box Backup (bbackupd)");
+	Logging::ToConsole(true);
+	Logging::ToSyslog (true);
+	
 #ifdef WIN32
 
-	::openlog("Box Backup (bbackupd)", LOG_PID, LOG_LOCAL6);
-
 	if(argc == 2 &&
 		(::strcmp(argv[1], "--help") == 0 ||
 		 ::strcmp(argv[1], "-h") == 0))
@@ -66,7 +69,7 @@
 
 	if (runAsWin32Service)
 	{
-		syslog(LOG_INFO, "Box Backup service starting");
+		BOX_INFO("Box Backup service starting");
 
 		char* config = NULL;
 		if (argc >= 3)
@@ -81,7 +84,7 @@
 			free(config);
 		}
 
-		syslog(LOG_INFO, "Box Backup service shut down");
+		BOX_INFO("Box Backup service shut down");
 	}
 	else
 	{




More information about the Boxbackup-commit mailing list