Index: trunk/src/libs/xpcom18a4/ipc/ipcd/client/src/ipcdclient.cpp
===================================================================
--- trunk/src/libs/xpcom18a4/ipc/ipcd/client/src/ipcdclient.cpp	(revision 102214)
+++ trunk/src/libs/xpcom18a4/ipc/ipcd/client/src/ipcdclient.cpp	(revision 102249)
@@ -35,5 +35,5 @@
  *
  * ***** END LICENSE BLOCK ***** */
-
+#define LOG_GROUP LOG_GROUP_IPC
 #include "ipcdclient.h"
 #include "ipcConnection.h"
@@ -41,5 +41,4 @@
 #include "ipcMessageQ.h"
 #include "ipcMessageUtils.h"
-#include "ipcLog.h"
 #include "ipcm.h"
 
@@ -62,4 +61,6 @@
 #include <iprt/process.h>
 #include <iprt/string.h>
+
+#include <VBox/log.h>
 
 /* ------------------------------------------------------------------------- */
@@ -280,5 +281,5 @@
       NS_ASSERTION(aTarget.Equals(IPCM_TARGET) || msg->Target().Equals(IPCM_TARGET),
                    "unexpected target");
-      LOG(("dropping IPCM message: type=%x\n", IPCM_GetType(msg)));
+      Log(("dropping IPCM message: type=%x\n", IPCM_GetType(msg)));
     }
     tempQ.DeleteFirst();
@@ -447,5 +448,5 @@
     mon.Wait(timeEnd - t);
 
-    LOG(("woke up from sleep [pendingQempty=%d connected=%d shutdown=%d isIPCMTarget=%d]\n",
+    Log(("woke up from sleep [pendingQempty=%d connected=%d shutdown=%d isIPCMTarget=%d]\n",
           td->pendingQ.IsEmpty(), gClientState->connected,
           gClientState->shutdown, isIPCMTarget));
@@ -694,5 +695,5 @@
     nsresult rv = MakeIPCMRequest(new ipcmMessageClientDelTarget(aTarget));
     if (NS_FAILED(rv))
-      LOG(("failed to delete target: rv=%x\n", rv));
+      Log(("failed to delete target: rv=%x\n", rv));
   }
 }
@@ -720,5 +721,5 @@
     if (NS_FAILED(rv))
     {
-      LOG(("failed to add target: rv=%x\n", rv));
+      Log(("failed to add target: rv=%x\n", rv));
       RemoveTarget(aTarget, PR_FALSE);
       return rv;
@@ -768,5 +769,5 @@
   else
   {
-    LOG(("unexpected response from CLIENT_HELLO message: type=%x!\n",
+    Log(("unexpected response from CLIENT_HELLO message: type=%x!\n",
         IPCM_GetType(msg)));
     rv = NS_ERROR_UNEXPECTED;
@@ -781,6 +782,4 @@
 {
   NS_ENSURE_TRUE(!gClientState, NS_ERROR_ALREADY_INITIALIZED);
-
-  IPC_InitLog(">>>");
 
   gClientState = ipcClientState::Create();
@@ -805,5 +804,5 @@
   NS_ENSURE_TRUE(gClientState, NS_ERROR_NOT_INITIALIZED);
 
-  LOG(("IPC_Shutdown: connected=%d\n",gClientState->connected));
+  Log(("IPC_Shutdown: connected=%d\n",gClientState->connected));
 
   if (gClientState->connected)
@@ -990,5 +989,5 @@
             status->ClientState() == IPCM_CLIENT_STATE_DOWN)
         {
-          LOG(("sender (%d) we're waiting a message from (%d) has died\n",
+          Log(("sender (%d) we're waiting a message from (%d) has died\n",
                status->ClientID(), data->senderID));
 
@@ -1024,5 +1023,5 @@
                  status->ClientState() == IPCM_CLIENT_STATE_UP)
         {
-          LOG(("sender (%d) we're waiting a message from (%d) has come up\n",
+          Log(("sender (%d) we're waiting a message from (%d) has come up\n",
                status->ClientID(), data->senderID));
           if (data->senderID == IPC_SENDER_ANY)
@@ -1195,5 +1194,5 @@
   else
   {
-    LOG(("unexpected IPCM response: type=%x\n", IPCM_GetType(msg)));
+    Log(("unexpected IPCM response: type=%x\n", IPCM_GetType(msg)));
     rv = NS_ERROR_UNEXPECTED;
   }
@@ -1321,9 +1320,8 @@
   td->pendingQ.Append(msg);
 
-#ifdef IPC_LOGGING
-  if (IPC_LOG_ENABLED())
+#ifdef LOG_ENABLED
   {
     char *targetStr = target.ToString();
-    LOG(("placed message on pending queue for target %s and notifying all...\n", targetStr));
+    Log(("placed message on pending queue for target %s and notifying all...\n", targetStr));
     nsMemory::Free(targetStr);
   }
@@ -1355,18 +1353,12 @@
 /* ------------------------------------------------------------------------- */
 
-#ifdef IPC_LOGGING
-#include "prprf.h"
-#include <ctype.h>
-#endif
-
 // called on a background thread
 void
 IPC_OnMessageAvailable(ipcMessage *msg)
 {
-#ifdef IPC_LOGGING
-  if (IPC_LOG_ENABLED())
+#ifdef LOG_ENABLED
   {
     char *targetStr = msg->Target().ToString();
-    LOG(("got message for target: %s\n", targetStr));
+    Log(("got message for target: %s\n", targetStr));
     nsMemory::Free(targetStr);
 
Index: trunk/src/libs/xpcom18a4/ipc/ipcd/daemon/src/ipcCommandModule.cpp
===================================================================
--- trunk/src/libs/xpcom18a4/ipc/ipcd/daemon/src/ipcCommandModule.cpp	(revision 102214)
+++ trunk/src/libs/xpcom18a4/ipc/ipcd/daemon/src/ipcCommandModule.cpp	(revision 102249)
@@ -35,8 +35,7 @@
  *
  * ***** END LICENSE BLOCK ***** */
-
+#define LOG_GROUP LOG_GROUP_IPC
 #include <stdlib.h>
 #include <string.h>
-#include "ipcLog.h"
 #include "ipcCommandModule.h"
 #include "ipcClient.h"
@@ -46,4 +45,6 @@
 #include "ipcm.h"
 
+#include <VBox/log.h>
+
 struct ipcCommandModule
 {
@@ -104,5 +105,5 @@
     OnPing(ipcClient *client, const ipcMessage *rawMsg)
     {
-        LOG(("got PING\n"));
+        Log(("got PING\n"));
 
         IPC_SendMsg(client, new ipcmMessageResult(IPCM_GetRequestIndex(rawMsg), IPCM_OK));
@@ -112,5 +113,5 @@
     OnClientHello(ipcClient *client, const ipcMessage *rawMsg)
     {
-        LOG(("got CLIENT_HELLO\n"));
+        Log(("got CLIENT_HELLO\n"));
 
         IPC_SendMsg(client, new ipcmMessageClientID(IPCM_GetRequestIndex(rawMsg), client->ID()));
@@ -129,5 +130,5 @@
     OnClientAddName(ipcClient *client, const ipcMessage *rawMsg)
     {
-        LOG(("got CLIENT_ADD_NAME\n"));
+        Log(("got CLIENT_ADD_NAME\n"));
 
         PRInt32 status = IPCM_OK;
@@ -139,5 +140,5 @@
             ipcClient *result = IPC_GetClientByName(msg->Name());
             if (result) {
-                LOG(("  client with such name already exists (ID = %d)\n", result->ID()));
+                Log(("  client with such name already exists (ID = %d)\n", result->ID()));
                 status = IPCM_ERROR_ALREADY_EXISTS;
             }
@@ -154,5 +155,5 @@
     OnClientDelName(ipcClient *client, const ipcMessage *rawMsg)
     {
-        LOG(("got CLIENT_DEL_NAME\n"));
+        Log(("got CLIENT_DEL_NAME\n"));
 
         PRInt32 status = IPCM_OK;
@@ -163,5 +164,5 @@
         if (name) {
             if (!client->DelName(name)) {
-                LOG(("  client doesn't have name '%s'\n", name));
+                Log(("  client doesn't have name '%s'\n", name));
                 status = IPCM_ERROR_NO_SUCH_DATA;
             }
@@ -176,5 +177,5 @@
     OnClientAddTarget(ipcClient *client, const ipcMessage *rawMsg)
     {
-        LOG(("got CLIENT_ADD_TARGET\n"));
+        Log(("got CLIENT_ADD_TARGET\n"));
 
         PRInt32 status = IPCM_OK;
@@ -183,5 +184,5 @@
         ipcMessageCast<ipcmMessageClientAddTarget> msg(rawMsg);
         if (client->HasTarget(msg->Target())) {
-            LOG(("  target already defined for client\n"));
+            Log(("  target already defined for client\n"));
             status = IPCM_ERROR_ALREADY_EXISTS;
         }
@@ -195,5 +196,5 @@
     OnClientDelTarget(ipcClient *client, const ipcMessage *rawMsg)
     {
-        LOG(("got CLIENT_DEL_TARGET\n"));
+        Log(("got CLIENT_DEL_TARGET\n"));
 
         PRInt32 status = IPCM_OK;
@@ -202,5 +203,5 @@
         ipcMessageCast<ipcmMessageClientDelTarget> msg(rawMsg);
         if (!client->DelTarget(msg->Target())) {
-            LOG(("  client doesn't have the given target\n"));
+            Log(("  client doesn't have the given target\n"));
             status = IPCM_ERROR_NO_SUCH_DATA;
         }
@@ -212,5 +213,5 @@
     OnQueryClientByName(ipcClient *client, const ipcMessage *rawMsg)
     {
-        LOG(("got QUERY_CLIENT_BY_NAME\n"));
+        Log(("got QUERY_CLIENT_BY_NAME\n"));
 
         PRUint32 requestIndex = IPCM_GetRequestIndex(rawMsg);
@@ -220,9 +221,9 @@
         ipcClient *result = IPC_GetClientByName(msg->Name());
         if (result) {
-            LOG(("  client exists w/ ID = %u\n", result->ID()));
+            Log(("  client exists w/ ID = %u\n", result->ID()));
             IPC_SendMsg(client, new ipcmMessageClientID(requestIndex, result->ID()));
         }
         else {
-            LOG(("  client does not exist\n"));
+            Log(("  client does not exist\n"));
             IPC_SendMsg(client, new ipcmMessageResult(requestIndex, IPCM_ERROR_NO_CLIENT));
         }
@@ -233,5 +234,5 @@
     OnQueryClientInfo(ipcClient *client, const ipcMessage *rawMsg)
     {
-        LOG(("got QUERY_CLIENT_INFO\n"));
+        Log(("got QUERY_CLIENT_INFO\n"));
 
         ipcMessageCast<ipcmMessageQueryClientInfo> msg(rawMsg);
@@ -250,5 +251,5 @@
         }
         else {
-            LOG(("  client does not exist\n"));
+            Log(("  client does not exist\n"));
             IPC_SendMsg(client, new ipcmMessageError(IPCM_ERROR_NO_CLIENT, msg->RequestIndex()));
         }
@@ -259,5 +260,5 @@
     OnForward(ipcClient *client, const ipcMessage *rawMsg)
     {
-        LOG(("got FORWARD\n"));
+        Log(("got FORWARD\n"));
 
         ipcMessageCast<ipcmMessageForward> msg(rawMsg);
@@ -265,5 +266,5 @@
         ipcClient *dest = IPC_GetClientByID(msg->ClientID());
         if (!dest) {
-            LOG(("  destination client not found!\n"));
+            Log(("  destination client not found!\n"));
             IPC_SendMsg(client, new ipcmMessageResult(IPCM_GetRequestIndex(rawMsg), IPCM_ERROR_NO_CLIENT));
             return;
@@ -297,8 +298,8 @@
 
     int type = IPCM_GetType(rawMsg);
-    LOG(("IPCM_HandleMsg [type=%x]\n", type));
+    Log(("IPCM_HandleMsg [type=%x]\n", type));
 
     if (!(type & IPCM_MSG_CLASS_REQ)) {
-        LOG(("not a request -- ignoring message\n"));
+        Log(("not a request -- ignoring message\n"));
         return;
     }
@@ -307,5 +308,5 @@
     type--;
     if (type < 0 || type >= (int) (sizeof(handlers)/sizeof(handlers[0]))) {
-        LOG(("unknown request -- ignoring message\n"));
+        Log(("unknown request -- ignoring message\n"));
         return;
     }
Index: trunk/src/libs/xpcom18a4/ipc/ipcd/daemon/src/ipcd.cpp
===================================================================
--- trunk/src/libs/xpcom18a4/ipc/ipcd/daemon/src/ipcd.cpp	(revision 102214)
+++ trunk/src/libs/xpcom18a4/ipc/ipcd/daemon/src/ipcd.cpp	(revision 102249)
@@ -35,7 +35,6 @@
  *
  * ***** END LICENSE BLOCK ***** */
-
+#define LOG_GROUP LOG_GROUP_IPC
 #include "ipcConfig.h"
-#include "ipcLog.h"
 #include "ipcMessage.h"
 #include "ipcClient.h"
Index: trunk/src/libs/xpcom18a4/ipc/ipcd/extensions/dconnect/src/ipcDConnectService.cpp
===================================================================
--- trunk/src/libs/xpcom18a4/ipc/ipcd/extensions/dconnect/src/ipcDConnectService.cpp	(revision 102214)
+++ trunk/src/libs/xpcom18a4/ipc/ipcd/extensions/dconnect/src/ipcDConnectService.cpp	(revision 102249)
@@ -36,9 +36,8 @@
  *
  * ***** END LICENSE BLOCK ***** */
-
+#define LOG_GROUP LOG_GROUP_IPC
 #include "ipcDConnectService.h"
 #include "ipcMessageWriter.h"
 #include "ipcMessageReader.h"
-#include "ipcLog.h"
 
 #include "nsIServiceManagerUtils.h"
@@ -61,4 +60,6 @@
 # include <iprt/time.h>
 # include <iprt/thread.h>
+
+# include <VBox/log.h>
 #endif /* VBOX */
 
@@ -452,5 +453,5 @@
     case nsXPTType::T_PWSTRING_SIZE_IS:
     default:
-      LOG(("unexpected parameter type: %d\n", t.TagPart()));
+      Log(("unexpected parameter type: %d\n", t.TagPart()));
       return NS_ERROR_UNEXPECTED;
   }
@@ -609,5 +610,5 @@
     case nsXPTType::T_PWSTRING_SIZE_IS:
     default:
-      LOG(("unexpected parameter type\n"));
+      Log(("unexpected parameter type\n"));
       return NS_ERROR_UNEXPECTED;
   }
@@ -646,5 +647,5 @@
 
       default:
-        LOG(("unhandled dipper: type=%d\n", t.TagPart()));
+        Log(("unhandled dipper: type=%d\n", t.TagPart()));
         return NS_ERROR_UNEXPECTED;
     }
@@ -855,5 +856,5 @@
     case nsXPTType::T_PWSTRING_SIZE_IS:
     default:
-      LOG(("unexpected parameter type\n"));
+      Log(("unexpected parameter type\n"));
       return NS_ERROR_UNEXPECTED;
   }
@@ -903,5 +904,5 @@
     if (pi.GetType().TagPart() != nsXPTType::T_U32)
     {
-      LOG(("unexpected size_is() parameter type: $d\n",
+      Log(("unexpected size_is() parameter type: $d\n",
            pi.GetType().TagPart()));
       return NS_ERROR_UNEXPECTED;
@@ -911,5 +912,5 @@
     if (pi.GetType().TagPart() != nsXPTType::T_U32)
     {
-      LOG(("unexpected length_is() parameter type: $d\n",
+      Log(("unexpected length_is() parameter type: $d\n",
            pi.GetType().TagPart()));
       return NS_ERROR_UNEXPECTED;
@@ -943,5 +944,5 @@
        elemType.IsReference()))
   {
-    LOG(("arrays of pointers and references to arithmetic types are "
+    Log(("arrays of pointers and references to arithmetic types are "
          "not yet supported\n"));
     return NS_ERROR_NOT_IMPLEMENTED;
@@ -950,5 +951,5 @@
   if (elemType.IsArray())
   {
-    LOG(("multidimensional arrays are not yet supported\n"));
+    Log(("multidimensional arrays are not yet supported\n"));
     return NS_ERROR_NOT_IMPLEMENTED;
   }
@@ -994,5 +995,5 @@
       break;
     default:
-      LOG(("unexpected parameter type: %d\n", type.TagPart()));
+      Log(("unexpected parameter type: %d\n", type.TagPart()));
       return NS_ERROR_UNEXPECTED;
   }
@@ -1101,5 +1102,5 @@
   if (prefix != 1)
   {
-    LOG(("unexpected array prefix: %u\n", prefix));
+    Log(("unexpected array prefix: %u\n", prefix));
     return NS_ERROR_UNEXPECTED;
   }
@@ -1255,5 +1256,5 @@
         break;
       default:
-        LOG(("unexpected parameter type: %d\n", elemType.TagPart()));
+        Log(("unexpected parameter type: %d\n", elemType.TagPart()));
         return;
     }
@@ -1387,5 +1388,5 @@
     if (aSenderID == IPC_SENDER_ANY && aTarget.Equals(nsID()) && !aData && !aDataLen)
     {
-        LOG(("DConnectMsgSelector::OnMessageAvailable: poll liveness for mPeer=%d\n",
+        Log(("DConnectMsgSelector::OnMessageAvailable: poll liveness for mPeer=%d\n",
              mPeer));
         ClientDownMap::iterator it = g_ClientDownMap.find(mPeer);
@@ -1432,5 +1433,5 @@
   {
     const DConnectOp *op = (const DConnectOp *) aData;
-    LOG((
+    Log((
       "DConnectCompletion::OnMessageAvailable: "
       "senderID=%d, opcode_major=%d, index=%d (waiting for %d)\n",
@@ -2236,12 +2237,9 @@
 DConnectStub::~DConnectStub()
 {
-#ifdef IPC_LOGGING
-  if (IPC_LOG_ENABLED())
-  {
-    const char *name = NULL;
-    mIInfo->GetNameShared(&name);
-    LOG(("{%p} DConnectStub::<dtor>(): peer=%d instance=0x%Lx {%s}\n",
-         this, mPeerID, mInstance, name));
-  }
+#ifdef LOG_ENABLED
+  const char *name = NULL;
+  mIInfo->GetNameShared(&name);
+  Log(("{%p} DConnectStub::<dtor>(): peer=%d instance=0x%Lx {%s}\n",
+       this, mPeerID, mInstance, name));
 #endif
 
@@ -2280,13 +2278,10 @@
 
 
-    #ifdef IPC_LOGGING
-    if (IPC_LOG_ENABLED())
-    {
-      const char *name;
-      mIInfo->GetNameShared(&name);
-      LOG(("{%p} DConnectStub::Release(): peer=%d instance=0x%Lx {%s}, new count=%d\n",
-          this, mPeerID, mInstance, name, count));
-    }
-    #endif
+#ifdef LOG_ENABLED
+    const char *name;
+    mIInfo->GetNameShared(&name);
+    Log(("{%p} DConnectStub::Release(): peer=%d instance=0x%Lx {%s}, new count=%d\n",
+        this, mPeerID, mInstance, name, count));
+#endif
 
     // mRefCntLevels may already be empty here (due to the "stabilize" trick below)
@@ -2441,6 +2436,5 @@
   // else, we need to query the peer object by making an IPC call
 
-#ifdef IPC_LOGGING
-  if (IPC_LOG_ENABLED())
+#ifdef LOG_ENABLED
   {
     const char *name;
@@ -2451,5 +2445,5 @@
     if (iinfoQ) {
         iinfoQ->GetNameShared(&nameQ);
-        LOG(("calling QueryInterface {%s} on peer object "
+        Log(("calling QueryInterface {%s} on peer object "
              "(stub=%p, instance=0x%Lx {%s})\n",
              nameQ, this, mInstance, name));
@@ -2494,5 +2488,5 @@
                          nsXPTCMiniVariant *aParams)
 {
-  LOG(("DConnectStub::CallMethod [methodIndex=%hu]\n", aMethodIndex));
+  Log(("DConnectStub::CallMethod [methodIndex=%hu]\n", aMethodIndex));
 
   nsresult rv;
@@ -2528,6 +2522,5 @@
   PRUint8 i, paramCount = aInfo->GetParamCount();
 
-#ifdef IPC_LOGGING
-  if (IPC_LOG_ENABLED())
+#ifdef LOG_ENABLED
   {
     const char *name;
@@ -2535,7 +2528,7 @@
     GetInterfaceInfo(getter_AddRefs(iinfo));
     iinfo->GetNameShared(&name);
-    LOG(("  instance=0x%Lx {%s}\n", mInstance, name));
-    LOG(("  name=%s\n", aInfo->GetName()));
-    LOG(("  param-count=%u\n", (PRUint32) paramCount));
+    Log(("  instance=0x%Lx {%s}\n", mInstance, name));
+    Log(("  name=%s\n", aInfo->GetName()));
+    Log(("  param-count=%u\n", (PRUint32) paramCount));
   }
 #endif
@@ -2553,5 +2546,5 @@
   invoke.method_index = aMethodIndex;
 
-  LOG(("  request-index=%d\n", (PRUint32) invoke.request_index));
+  Log(("  request-index=%d\n", (PRUint32) invoke.request_index));
 
   writer.PutBytes(&invoke, sizeof(invoke));
@@ -2629,5 +2622,5 @@
                        writer.GetBuffer(),
                        writer.GetSize());
-  LOG(("DConnectStub::CallMethod: IPC_SendMessage()=%08X\n", rv));
+  Log(("DConnectStub::CallMethod: IPC_SendMessage()=%08X\n", rv));
   if (NS_FAILED(rv))
   {
@@ -2650,5 +2643,5 @@
                          &completion.GetSelector(), &completion,
                          DCON_WAIT_TIMEOUT);
-    LOG(("DConnectStub::CallMethod: IPC_WaitMessage()=%08X\n", rv));
+    Log(("DConnectStub::CallMethod: IPC_WaitMessage()=%08X\n", rv));
     if (NS_FAILED(rv))
     {
@@ -2723,5 +2716,5 @@
   if (completion.Reply()->flags & DCON_OP_FLAGS_REPLY_EXCEPTION)
   {
-    LOG(("got nsIException instance, will create a stub\n"));
+    Log(("got nsIException instance, will create a stub\n"));
 
     nsIException *xcpt = nsnull;
@@ -2767,5 +2760,5 @@
     const DConnectSetupReply *reply = (const DConnectSetupReply *) op;
 
-    LOG(("got SETUP_REPLY: status=%x instance=0x%Lx\n", reply->status, reply->instance));
+    Log(("got SETUP_REPLY: status=%x instance=0x%Lx\n", reply->status, reply->instance));
 
     mStatus = reply->status;
@@ -2792,5 +2785,5 @@
       ipcMessageReader reader(params, paramsLen);
 
-      LOG(("got nsIException instance, will create a stub\n"));
+      Log(("got nsIException instance, will create a stub\n"));
 
       nsresult rv;
@@ -2947,5 +2940,5 @@
 DConnectWorker::Run()
 {
-  LOG(("DConnect Worker thread started.\n"));
+  Log(("DConnect Worker thread started.\n"));
 
   mIsRunnable = PR_TRUE;
@@ -2978,5 +2971,5 @@
     else
     {
-      LOG(("DConnect Worker thread got request.\n"));
+      Log(("DConnect Worker thread got request.\n"));
 
       // remove the request from the queue
@@ -3002,5 +2995,5 @@
   mIsRunnable = PR_FALSE;
 
-  LOG(("DConnect Worker thread stopped.\n"));
+  Log(("DConnect Worker thread stopped.\n"));
   return NS_OK;
 }
@@ -3051,12 +3044,9 @@
   // disregarding the reference counter
 
-#ifdef IPC_LOGGING
-  if (IPC_LOG_ENABLED())
-  {
-    const char *name;
-    aData->InterfaceInfo()->GetNameShared(&name);
-    LOG(("ipcDConnectService: WARNING: deleting unreleased "
-         "instance=%p iface=%p {%s}\n", aData, aData->RealInstance(), name));
-  }
+#ifdef LOG_ENABLED
+  const char *name;
+  aData->InterfaceInfo()->GetNameShared(&name);
+  Log(("ipcDConnectService: WARNING: deleting unreleased "
+       "instance=%p iface=%p {%s}\n", aData, aData->RealInstance(), name));
 #endif
 
@@ -3091,5 +3081,5 @@
   nsresult rv;
 
-  LOG(("ipcDConnectService::Init.\n"));
+  Log(("ipcDConnectService::Init.\n"));
 
   rv = IPC_DefineTarget(kDConnectTargetID, this);
@@ -3172,5 +3162,5 @@
   mInstance = this;
 
-  LOG(("ipcDConnectService::Init NS_OK.\n"));
+  Log(("ipcDConnectService::Init NS_OK.\n"));
   return NS_OK;
 }
@@ -3221,6 +3211,6 @@
   fprintf(stderr, "ipcDConnectService Stats\n");
   fprintf(stderr, " => number of worker threads: %d\n", mWorkers.Count());
-  LOG(("ipcDConnectService Stats\n"));
-  LOG((" => number of worker threads: %d\n", mWorkers.Count()));
+  Log(("ipcDConnectService Stats\n"));
+  Log((" => number of worker threads: %d\n", mWorkers.Count()));
 #endif
 
@@ -3230,5 +3220,5 @@
   // exited a working loop and abandon ones which have not
   // managed to do that when timeout occurred.
-  LOG(("Worker threads: %d\n", mWorkers.Count()));
+  Log(("Worker threads: %d\n", mWorkers.Count()));
   uint64_t tsStart = RTTimeMilliTS();
   while ((tsStart + VBOX_XPCOM_SHUTDOWN_TIMEOUT_MS ) > RTTimeMilliTS() && mWorkers.Count() > 0)
@@ -3242,5 +3232,5 @@
       if (worker->IsRunning() == PR_FALSE)
       {
-        LOG(("Worker %p joined.\n", worker));
+        Log(("Worker %p joined.\n", worker));
         worker->Join();
         delete worker;
@@ -3257,5 +3247,5 @@
   }
 
-  LOG(("There are %d thread(s) left.\n", mWorkers.Count()));
+  Log(("There are %d thread(s) left.\n", mWorkers.Count()));
 
   // If there are some running threads left, terminate the process.
@@ -3333,12 +3323,9 @@
 ipcDConnectService::StoreInstance(DConnectInstance *wrapper)
 {
-#ifdef IPC_LOGGING
-  if (IPC_LOG_ENABLED())
-  {
-    const char *name;
-    wrapper->InterfaceInfo()->GetNameShared(&name);
-    LOG(("ipcDConnectService::StoreInstance(): instance=%p iface=%p {%s}\n",
-         wrapper, wrapper->RealInstance(), name));
-  }
+#ifdef LOG_ENABLED
+  const char *name;
+  wrapper->InterfaceInfo()->GetNameShared(&name);
+  Log(("ipcDConnectService::StoreInstance(): instance=%p iface=%p {%s}\n",
+       wrapper, wrapper->RealInstance(), name));
 #endif
 
@@ -3361,12 +3348,9 @@
     RTSemFastMutexRequest(mLock);
 
-#ifdef IPC_LOGGING
-  if (IPC_LOG_ENABLED())
-  {
-    const char *name;
-    wrapper->InterfaceInfo()->GetNameShared(&name);
-    LOG(("ipcDConnectService::DeleteInstance(): instance=%p iface=%p {%s}\n",
-         wrapper, wrapper->RealInstance(), name));
-  }
+#ifdef LOG_ENABLED
+  const char *name;
+  wrapper->InterfaceInfo()->GetNameShared(&name);
+  Log(("ipcDConnectService::DeleteInstance(): instance=%p iface=%p {%s}\n",
+       wrapper, wrapper->RealInstance(), name));
 #endif
 
@@ -3406,14 +3390,11 @@
 ipcDConnectService::StoreStub(DConnectStub *stub)
 {
-#ifdef IPC_LOGGING
-  if (IPC_LOG_ENABLED())
-  {
-    const char *name;
-    nsCOMPtr<nsIInterfaceInfo> iinfo;
-    stub->GetInterfaceInfo(getter_AddRefs(iinfo));
-    iinfo->GetNameShared(&name);
-    LOG(("ipcDConnectService::StoreStub(): stub=%p instance=0x%Lx {%s}\n",
-         stub, stub->Instance(), name));
-  }
+#ifdef LOG_ENABLED
+  const char *name;
+  nsCOMPtr<nsIInterfaceInfo> iinfo;
+  stub->GetInterfaceInfo(getter_AddRefs(iinfo));
+  iinfo->GetNameShared(&name);
+  Log(("ipcDConnectService::StoreStub(): stub=%p instance=0x%Lx {%s}\n",
+       stub, stub->Instance(), name));
 #endif
 
@@ -3425,14 +3406,11 @@
 ipcDConnectService::DeleteStub(DConnectStub *stub)
 {
-#ifdef IPC_LOGGING
-  if (IPC_LOG_ENABLED())
-  {
-    const char *name;
-    nsCOMPtr<nsIInterfaceInfo> iinfo;
-    stub->GetInterfaceInfo(getter_AddRefs(iinfo));
-    iinfo->GetNameShared(&name);
-    LOG(("ipcDConnectService::DeleteStub(): stub=%p instance=0x%Lx {%s}\n",
-         stub, stub->Instance(), name));
-  }
+#ifdef LOG_ENABLED
+  const char *name;
+  nsCOMPtr<nsIInterfaceInfo> iinfo;
+  stub->GetInterfaceInfo(getter_AddRefs(iinfo));
+  iinfo->GetNameShared(&name);
+  Log(("ipcDConnectService::DeleteStub(): stub=%p instance=0x%Lx {%s}\n",
+       stub, stub->Instance(), name));
 #endif
 
@@ -3547,5 +3525,5 @@
   const DConnectOp *op = (const DConnectOp *) aData;
 
-  LOG (("ipcDConnectService::OnMessageAvailable: "
+  Log (("ipcDConnectService::OnMessageAvailable: "
         "senderID=%d, opcode_major=%d, index=%d\n",
         aSenderID, op->opcode_major, op->request_index));
@@ -3623,5 +3601,5 @@
     nsrefcnt countIPC = aData->ReleaseIPC(PR_TRUE /* locked */);
 
-    LOG(("ipcDConnectService::PruneInstanceMapForPeer: "
+    Log(("ipcDConnectService::PruneInstanceMapForPeer: "
          "instance=%p: %d IPC refs to release\n",
          aData, countIPC + 1));
@@ -3655,5 +3633,5 @@
                                         PRUint32 aClientState)
 {
-  LOG(("ipcDConnectService::OnClientStateChange: aClientID=%d, aClientState=%d\n",
+  Log(("ipcDConnectService::OnClientStateChange: aClientID=%d, aClientState=%d\n",
        aClientID, aClientState));
 
@@ -3668,5 +3646,5 @@
     else
     {
-      LOG(("ipcDConnectService::OnClientStateChange: "
+      Log(("ipcDConnectService::OnClientStateChange: "
            "pruning all instances created for peer %d...\n", aClientID));
 
@@ -3681,5 +3659,5 @@
       }
 
-      LOG(("ipcDConnectService::OnClientStateChange: "
+      Log(("ipcDConnectService::OnClientStateChange: "
            "%d lost instances\n", wrappers.Count()));
 
@@ -3893,5 +3871,5 @@
         if (NS_SUCCEEDED(rv2))
         {
-          LOG(("got nsIException instance, will serialize\n"));
+          Log(("got nsIException instance, will serialize\n"));
           got_exception = PR_TRUE;
         }
@@ -3934,5 +3912,5 @@
   if (NS_FAILED(rv))
   {
-    LOG(("unable to send SETUP_REPLY: rv=%x\n", rv));
+    Log(("unable to send SETUP_REPLY: rv=%x\n", rv));
     ReleaseWrappers(wrappers, peer);
   }
@@ -3942,5 +3920,5 @@
 ipcDConnectService::OnRelease(PRUint32 peer, const DConnectRelease *release)
 {
-  LOG(("ipcDConnectService::OnRelease [peer=%u instance=0x%Lx]\n",
+  Log(("ipcDConnectService::OnRelease [peer=%u instance=0x%Lx]\n",
        peer, release->instance));
 
@@ -3969,5 +3947,5 @@
     // client gets processed here (because of true multithreading). Just log
     // a debug warning
-    LOG(("ipcDConnectService::OnRelease: WARNING: "
+    Log(("ipcDConnectService::OnRelease: WARNING: "
          "instance wrapper %p for peer %d not found", wrapper, peer));
   }
@@ -3977,5 +3955,5 @@
 ipcDConnectService::OnInvoke(PRUint32 peer, const DConnectInvoke *invoke, PRUint32 opLen)
 {
-  LOG(("ipcDConnectService::OnInvoke [peer=%u instance=0x%Lx method=%u]\n",
+  Log(("ipcDConnectService::OnInvoke [peer=%u instance=0x%Lx method=%u]\n",
       peer, invoke->instance, invoke->method_index));
 
@@ -4010,8 +3988,8 @@
   paramCount = methodInfo->GetParamCount();
 
-  LOG(("  iface=%p\n", wrapper->RealInstance()));
-  LOG(("  name=%s\n", methodInfo->GetName()));
-  LOG(("  param-count=%u\n", (PRUint32) paramCount));
-  LOG(("  request-index=%d\n", (PRUint32) invoke->request_index));
+  Log(("  iface=%p\n", wrapper->RealInstance()));
+  Log(("  name=%s\n", methodInfo->GetName()));
+  Log(("  param-count=%u\n", (PRUint32) paramCount));
+  Log(("  request-index=%d\n", (PRUint32) invoke->request_index));
 
   params = new nsXPTCVariant[paramCount];
@@ -4114,5 +4092,5 @@
         if (NS_SUCCEEDED(rv2))
         {
-          LOG(("got nsIException instance, will serialize\n"));
+          Log(("got nsIException instance, will serialize\n"));
           got_exception = PR_TRUE;
         }
@@ -4125,5 +4103,5 @@
 
 end:
-  LOG(("sending INVOKE_REPLY: rv=%x\n", rv));
+  Log(("sending INVOKE_REPLY: rv=%x\n", rv));
 
   // balance CheckInstanceAndAddRef()
@@ -4215,5 +4193,5 @@
   if (NS_FAILED(rv))
   {
-    LOG(("unable to send INVOKE_REPLY: rv=%x\n", rv));
+    Log(("unable to send INVOKE_REPLY: rv=%x\n", rv));
     ReleaseWrappers(wrappers, peer);
   }
Index: trunk/src/libs/xpcom18a4/ipc/ipcd/extensions/lock/src/ipcLockService.cpp
===================================================================
--- trunk/src/libs/xpcom18a4/ipc/ipcd/extensions/lock/src/ipcLockService.cpp	(revision 102214)
+++ trunk/src/libs/xpcom18a4/ipc/ipcd/extensions/lock/src/ipcLockService.cpp	(revision 102249)
@@ -37,4 +37,5 @@
  * ***** END LICENSE BLOCK ***** */
 
+#define LOG_GROUP LOG_GROUP_IPC
 #include <stdlib.h>
 #include "nsDependentString.h"
@@ -43,7 +44,8 @@
 #include "ipcLockService.h"
 #include "ipcLockProtocol.h"
-#include "ipcLog.h"
 
 #include <iprt/errcore.h>
+#include <VBox/log.h>
+
 
 static const nsID kLockTargetID = IPC_LOCK_TARGETID;
@@ -80,5 +82,5 @@
 ipcLockService::AcquireLock(const char *lockName, PRBool waitIfBusy)
 {
-    LOG(("ipcLockService::AcquireLock [lock=%s wait=%u]\n", lockName, waitIfBusy));
+    LogFlowFunc(("ipcLockService::AcquireLock [lock=%s wait=%u]\n", lockName, waitIfBusy));
 
     ipcLockMsg msg;
@@ -123,5 +125,5 @@
 ipcLockService::ReleaseLock(const char *lockName)
 {
-    LOG(("ipcLockService::ReleaseLock [lock=%s]\n", lockName));
+    LogFlowFunc(("ipcLockService::ReleaseLock [lock=%s]\n", lockName));
 
     ipcLockMsg msg;
@@ -152,5 +154,5 @@
     IPC_UnflattenLockMsg(data, dataLen, &msg);
 
-    LOG(("ipcLockService::OnMessageAvailable [lock=%s opcode=%u]\n", msg.key, msg.opcode));
+    LogFlowFunc(("ipcLockService::OnMessageAvailable [lock=%s opcode=%u]\n", msg.key, msg.opcode));
 
     ipcPendingLock *pendingLock = (ipcPendingLock *) RTTlsGet(mTPIndex);
@@ -164,5 +166,5 @@
     }
 
-    LOG(("message does not match; waiting for another...\n"));
+    LogFlowFunc(("message does not match; waiting for another...\n"));
 
     // else, we got a message that another thread is waiting to receive.
Index: trunk/src/libs/xpcom18a4/ipc/ipcd/shared/src/ipcConfig.cpp
===================================================================
--- trunk/src/libs/xpcom18a4/ipc/ipcd/shared/src/ipcConfig.cpp	(revision 102214)
+++ trunk/src/libs/xpcom18a4/ipc/ipcd/shared/src/ipcConfig.cpp	(revision 102249)
@@ -35,4 +35,5 @@
  *
  * ***** END LICENSE BLOCK ***** */
+#define LOG_GROUP LOG_GROUP_IPC
 
 #if defined(XP_WIN)
@@ -46,8 +47,8 @@
 #endif
 #include "ipcConfig.h"
-#include "ipcLog.h"
 #include "plstr.h"
 
 #include <iprt/env.h>
+#include <VBox/log.h>
 
 #if defined(XP_OS2) && !defined(XP_OS2_NATIVEIPC)
@@ -89,5 +90,5 @@
             logName = RTEnvGet("USER");
             if (!logName || !logName[0]) {
-                LOG(("could not determine username from environment\n"));
+                Log(("could not determine username from environment\n"));
                 goto end;
             }
Index: trunk/src/libs/xpcom18a4/ipc/ipcd/shared/src/ipcLog.cpp
===================================================================
--- trunk/src/libs/xpcom18a4/ipc/ipcd/shared/src/ipcLog.cpp	(revision 102214)
+++ 	(revision )
@@ -1,117 +1,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Mozilla IPC.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Darin Fisher <darin@netscape.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "ipcLog.h"
-
-#ifdef IPC_LOGGING
-
-#include <string.h>
-#include <ctype.h>
-
-#include "prprf.h"
-#include "plstr.h"
-
-#include <iprt/initterm.h> // for RTR3InitDll
-
-char ipcLogPrefix[10] = {0};
-
-//-----------------------------------------------------------------------------
-// logging API impl
-//-----------------------------------------------------------------------------
-
-void
-IPC_InitLog(const char *prefix)
-{
-    // initialize VBox Runtime
-    RTR3InitDll(RTR3INIT_FLAGS_UNOBTRUSIVE);
-
-    PL_strncpyz(ipcLogPrefix, prefix, sizeof(ipcLogPrefix));
-}
-
-void
-IPC_Log(const char *fmt, ... )
-{
-    va_list ap;
-    va_start(ap, fmt);
-    PRUint32 nb = 0;
-    char buf[512];
-
-    if (ipcLogPrefix[0]) {
-        nb = strlen(ipcLogPrefix);
-        if (nb > sizeof(buf) - 2)
-            nb = sizeof(buf) - 2;
-        PL_strncpy(buf, ipcLogPrefix, nb);
-        buf[nb++] = ' ';
-    }
-
-    PR_vsnprintf(buf + nb, sizeof(buf) - nb, fmt, ap);
-    buf[sizeof(buf) - 1] = '\0';
-
-    LogFlow(("%s", buf));
-    va_end(ap);
-}
-
-void
-IPC_LogBinary(const PRUint8 *data, PRUint32 len)
-{
-    PRUint32 i, j, ln;
-    for (i=0; i<len; ) {
-        char line[100] = "";
-        const PRUint8 *p;
-
-        ln = 0;
-
-        p = &data[i];
-        for (j=0; j<PR_MIN(8, len - i); ++j, ++p)
-            ln += PR_snprintf(line + ln, sizeof(line) - ln, "%02x  ", *p);
-
-        for (; ln < 32; ++ln)
-            line[ln] = ' ';
-
-        p = &data[i];
-        for (j=0; j<PR_MIN(8, len - i); ++j, ++p)
-            ln += PR_snprintf(line + ln, sizeof(line) - ln, "%c", isprint(*p) ? *p : '.');
-
-        line[ln] = '\0';
-
-        i += (p - &data[i]);
-
-        LOG(("%s\n", line));
-    }
-}
-
-#endif // IPC_LOGGING
Index: trunk/src/libs/xpcom18a4/ipc/ipcd/shared/src/ipcLog.h
===================================================================
--- trunk/src/libs/xpcom18a4/ipc/ipcd/shared/src/ipcLog.h	(revision 102214)
+++ 	(revision )
@@ -1,111 +1,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Mozilla IPC.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Darin Fisher <darin@netscape.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef ipcLog_h__
-#define ipcLog_h__
-
-#include "nscore.h"
-#include "prtypes.h"
-
-#ifndef VBOX
-#ifdef DEBUG
-#define IPC_LOGGING
-#endif
-#endif
-
-#ifdef IPC_LOGGING
-
-#ifdef VBOX
-
-/* Redefine logging group to IPC */
-# ifdef LOG_GROUP
-#  undef LOG_GROUP
-# endif
-# define LOG_GROUP LOG_GROUP_IPC
-
-/* Ensure log macros are enabled */
-# ifndef LOG_ENABLED
-#  define LOG_ENABLED
-# endif
-
-#include <VBox/log.h>
-
-extern NS_HIDDEN_(void) IPC_InitLog(const char *prefix);
-extern NS_HIDDEN_(void) IPC_Log(const char *fmt, ...);
-extern NS_HIDDEN_(void) IPC_LogBinary(const PRUint8 *data, PRUint32 len);
-
-# define IPC_LOG(_args) \
-    PR_BEGIN_MACRO \
-        if (IPC_LOG_ENABLED()) \
-            IPC_Log _args; \
-    PR_END_MACRO
-
-/* IPC_Log() internally uses LogFlow() so use LogIsFlowEnabled() below */
-# define IPC_LOG_ENABLED() (LogIsFlowEnabled())
-
-# define LOG(args)     IPC_LOG(args)
-
-#else  /* !VBOX */
-
-extern PRBool ipcLogEnabled;
-extern NS_HIDDEN_(void) IPC_InitLog(const char *prefix);
-extern NS_HIDDEN_(void) IPC_Log(const char *fmt, ...);
-extern NS_HIDDEN_(void) IPC_LogBinary(const PRUint8 *data, PRUint32 len);
-
-#define IPC_LOG(_args)         \
-    PR_BEGIN_MACRO             \
-        if (ipcLogEnabled)     \
-            IPC_Log _args;     \
-    PR_END_MACRO
-
-#define IPC_LOG_ENABLED() ipcLogEnabled
-    
-#define LOG(args)     IPC_LOG(args)
-
-#endif /* !VBOX */
-
-#else // IPC_LOGGING
-
-#define IPC_InitLog(prefix) PR_BEGIN_MACRO PR_END_MACRO
-#define IPC_LogBinary(data, len) PR_BEGIN_MACRO PR_END_MACRO
-#define IPC_LOG(_args) PR_BEGIN_MACRO PR_END_MACRO
-#define IPC_LOG_ENABLED() (0)
-#define LOG(args) PR_BEGIN_MACRO PR_END_MACRO
-
-#endif // IPC_LOGGING
-
-#endif // !ipcLog_h__
