[mapguide-commits] r5043 - in trunk/MgDev/Server/src: Common/Manager Services/Site

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Jul 20 12:45:02 EDT 2010


Author: brucedechant
Date: 2010-07-20 16:45:02 +0000 (Tue, 20 Jul 2010)
New Revision: 5043

Modified:
   trunk/MgDev/Server/src/Common/Manager/LogManager.h
   trunk/MgDev/Server/src/Services/Site/OpAuthenticate.cpp
Log:
Update debugging messages.

- Added debugging for log manager macros


Modified: trunk/MgDev/Server/src/Common/Manager/LogManager.h
===================================================================
--- trunk/MgDev/Server/src/Common/Manager/LogManager.h	2010-07-19 20:38:27 UTC (rev 5042)
+++ trunk/MgDev/Server/src/Common/Manager/LogManager.h	2010-07-20 16:45:02 UTC (rev 5043)
@@ -200,12 +200,25 @@
         operationMessage += L"false"; \
     }
 
+#ifdef _DEBUG
 #define MG_LOG_OPERATION_MESSAGE_ACCESS_ENTRY() \
+    ACE_DEBUG((LM_DEBUG, ACE_TEXT("  (%t) %W\n"), operationMessage.c_str())); \
     MG_LOG_ACCESS_ENTRY(operationMessage.c_str(), connInfoClient.c_str(), connInfoClientIp.c_str(), connInfoUserName.c_str());
+#else
+#define MG_LOG_OPERATION_MESSAGE_ACCESS_ENTRY() \
+    MG_LOG_ACCESS_ENTRY(operationMessage.c_str(), connInfoClient.c_str(), connInfoClientIp.c_str(), connInfoUserName.c_str());
+#endif
 
+#ifdef _DEBUG
 #define MG_LOG_OPERATION_MESSAGE_ADMIN_ENTRY() \
+    ACE_DEBUG((LM_DEBUG, ACE_TEXT("  (%t) %W\n"), operationMessage.c_str())); \
     MG_LOG_ADMIN_ENTRY(operationMessage.c_str(), connInfoClient.c_str(), connInfoClientIp.c_str(), connInfoUserName.c_str());
+#else
+#define MG_LOG_OPERATION_MESSAGE_ADMIN_ENTRY() \
+    MG_LOG_ADMIN_ENTRY(operationMessage.c_str(), connInfoClient.c_str(), connInfoClientIp.c_str(), connInfoUserName.c_str());
+#endif
 
+
 #define MG_CONNECTION_INFO \
     STRING connInfoClient = L""; \
     STRING connInfoClientIp = L""; \

Modified: trunk/MgDev/Server/src/Services/Site/OpAuthenticate.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Site/OpAuthenticate.cpp	2010-07-19 20:38:27 UTC (rev 5042)
+++ trunk/MgDev/Server/src/Services/Site/OpAuthenticate.cpp	2010-07-20 16:45:02 UTC (rev 5043)
@@ -54,12 +54,16 @@
 {
     ACE_DEBUG((LM_DEBUG, ACE_TEXT("  (%t) MgOpAuthenticate::Execute()\n")));
 
-    // Disabled logging this operation because it is called very often
-//  MG_LOG_OPERATION_MESSAGE(L"Authenticate");
+    // Only log this operation for DEBUG builds because it is called very often
+#ifdef _DEBUG
+    MG_LOG_OPERATION_MESSAGE(L"Authenticate");
+#endif
 
     MG_SITE_SERVICE_TRY()
 
-//  MG_LOG_OPERATION_MESSAGE_INIT(m_packet.m_OperationVersion, m_packet.m_NumArguments);
+#ifdef _DEBUG
+    MG_LOG_OPERATION_MESSAGE_INIT(m_packet.m_OperationVersion, m_packet.m_NumArguments);
+#endif
 
     ACE_ASSERT(m_stream != NULL);
 
@@ -74,14 +78,15 @@
 
         BeginExecution();
 
-//      MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
-//      MG_LOG_OPERATION_MESSAGE_ADD_STRING(L"MgUserInformation");
-//      MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
-//      MG_LOG_OPERATION_MESSAGE_ADD_STRING(L"MgStringCollection");
-//      MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
-//      MG_LOG_OPERATION_MESSAGE_ADD_BOOL(returnAssignedRoles);
-//      MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
-
+#ifdef _DEBUG
+        MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
+        MG_LOG_OPERATION_MESSAGE_ADD_STRING(L"MgUserInformation");
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_STRING(L"MgStringCollection");
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_BOOL(returnAssignedRoles);
+        MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
+#endif
         // Validate() not called here since this is the operation that performs authentication.
 
         Ptr<MgStringCollection> assignedRoles = m_service->Authenticate(userInfo,
@@ -91,8 +96,10 @@
     }
     else
     {
-//      MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
-//      MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
+#ifdef _DEBUG
+        MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
+        MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
+#endif
     }
 
     if (!m_argsRead)
@@ -102,18 +109,24 @@
     }
 
     // Successful operation
-//  MG_LOG_OPERATION_MESSAGE_ADD_STRING(MgResources::Success.c_str());
+#ifdef _DEBUG
+    MG_LOG_OPERATION_MESSAGE_ADD_STRING(MgResources::Success.c_str());
+#endif
 
     MG_SITE_SERVICE_CATCH(L"MgOpAuthenticate.Execute")
 
     if (mgException != NULL)
     {
         // Failed operation
-//      MG_LOG_OPERATION_MESSAGE_ADD_STRING(MgResources::Failure.c_str());
+#ifdef _DEBUG
+        MG_LOG_OPERATION_MESSAGE_ADD_STRING(MgResources::Failure.c_str());
+#endif
     }
 
     // Add admin log entry for operation
-//  MG_LOG_OPERATION_MESSAGE_ADMIN_ENTRY();
+#ifdef _DEBUG
+    MG_LOG_OPERATION_MESSAGE_ADMIN_ENTRY();
+#endif
 
     MG_SITE_SERVICE_THROW()
 }



More information about the mapguide-commits mailing list