usbmgmt/usbmgr/usbman/chargingplugin/src/chargingstates.cpp
branchRCL_3
changeset 43 012cc2ee6408
parent 42 f92a4f87e424
--- a/usbmgmt/usbmgr/usbman/chargingplugin/src/chargingstates.cpp	Tue Aug 31 17:01:47 2010 +0300
+++ b/usbmgmt/usbmgr/usbman/chargingplugin/src/chargingstates.cpp	Wed Sep 01 12:35:00 2010 +0100
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -20,16 +20,14 @@
 @internalComponent
 */
 
+#include "chargingstates.h"
 #include <usb/usblogger.h>
-#include "chargingstates.h"
 #include "reenumerator.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "chargingstatesTraces.h"
+
+#ifdef __FLOG_ACTIVE
+_LIT8(KLogComponent, "USBCHARGEStates");
 #endif
 
-
-
 // Charging plugin base state
 
 // Empty virtual function implement to give a base of each state class. 
@@ -37,38 +35,32 @@
 void TUsbBatteryChargingPluginStateBase::UsbServiceStateChange(TInt aLastError,
     TUsbServiceState aOldState, TUsbServiceState aNewState)
     {
-    OstTraceFunctionEntry0( REF_TUSBBATTERYCHARGINGPLUGINSTATEBASE_USBSERVICESTATECHANGE_ENTRY );
+    LOG_FUNC
     
     (void)aLastError;
     (void)aOldState;
     (void)aNewState;
     
     // Not use
-    OstTraceFunctionExit0( REF_TUSBBATTERYCHARGINGPLUGINSTATEBASE_USBSERVICESTATECHANGE_EXIT );
     }
 
 void TUsbBatteryChargingPluginStateBase::UsbDeviceStateChange(TInt aLastError,
     TUsbDeviceState aOldState, TUsbDeviceState aNewState)
     {
-    OstTraceFunctionEntry0( REF_TUSBBATTERYCHARGINGPLUGINSTATEBASE_USBDEVICESTATECHANGE_ENTRY );
+    LOG_FUNC
     
     (void)aLastError;
     (void)aOldState;
     (void)aNewState;
-    OstTraceFunctionExit0( REF_TUSBBATTERYCHARGINGPLUGINSTATEBASE_USBDEVICESTATECHANGE_EXIT );
     }
 
 void TUsbBatteryChargingPluginStateBase::HandleRepositoryValueChangedL(
     const TUid& aRepository, TUint aId, TInt aVal)
     {
-    OstTraceFunctionEntry0( REF_TUSBBATTERYCHARGINGPLUGINSTATEBASE_HANDLEREPOSITORYVALUECHANGEDL_ENTRY );
+    LOG_FUNC
     
-    OstTraceExt3( TRACE_NORMAL, REF_TUSBBATTERYCHARGINGPLUGINSTATEBASE_HANDLEREPOSITORYVALUECHANGEDL, 
-            "TUsbBatteryChargingPluginStateBase::HandleRepositoryValueChangedL;aRepository = 0x%08x;aId=%d;aVal=%d", 
-            aRepository.iUid, aId, (TInt32)aVal );
-    OstTraceExt2( TRACE_NORMAL, REF_TUSBBATTERYCHARGINGPLUGINSTATEBASE_HANDLEREPOSITORYVALUECHANGEDL_DUP1, 
-            "TUsbBatteryChargingPluginStateBase::HandleRepositoryValueChangedL;Plugin State = %d, Device State = %d",
-            iParent.iPluginState, iParent.iDeviceState );
+    LOGTEXT4(_L8(">>TUsbBatteryChargingPluginStateBase::HandleRepositoryValueChangedL aRepository = 0x%08x, aId = %d, aVal = %d"), aRepository, aId, aVal);
+    LOGTEXT3(_L8("Plugin State = %d, Device State = %d"), iParent.iPluginState, iParent.iDeviceState);
     
     if ((aRepository == KUsbBatteryChargingCentralRepositoryUid) &&
             (aId == KUsbBatteryChargingKeyEnabledUserSetting))
@@ -93,13 +85,12 @@
             iParent.SetState(EPluginStateUserDisabled);
             }
         }
-    OstTraceFunctionExit0( REF_TUSBBATTERYCHARGINGPLUGINSTATEBASE_HANDLEREPOSITORYVALUECHANGEDL_EXIT );
     }
     
 void TUsbBatteryChargingPluginStateBase::DeviceStateTimeout()
     {
-    OstTraceFunctionEntry0( REF_TUSBBATTERYCHARGINGPLUGINSTATEBASE_DEVICESTATETIMEOUT_ENTRY );
-    OstTraceExt3( TRACE_NORMAL, REF_TUSBBATTERYCHARGINGPLUGINSTATEBASE_DEVICESTATETIMEOUT, "TUsbBatteryChargingPluginStateBase::DeviceStateTimeout;Time: %u Plugin State = %d, Device State = %d", User::NTickCount(), (TInt32)iParent.iPluginState, (TInt32)iParent.iDeviceState );
+    LOG_FUNC
+    LOGTEXT4(_L8("Time: %d Plugin State = %d, Device State = %d"), User::NTickCount(), iParent.iPluginState, iParent.iDeviceState);
     
     iParent.iDeviceReEnumerator->Cancel(); // cancel re-enumeration AO
     
@@ -108,16 +99,15 @@
         // Should not happen !!! Otherwise, something wrong!!!
         iParent.SetState(EPluginStateIdle);
         }
-    OstTraceFunctionExit0( REF_TUSBBATTERYCHARGINGPLUGINSTATEBASE_DEVICESTATETIMEOUT_EXIT );
     }
 
 // For host OTG enabled charging plug-in
 #ifdef SYMBIAN_ENABLE_USB_OTG_HOST_PRIV
 void TUsbBatteryChargingPluginStateBase::MpsoIdPinStateChanged(TInt aValue)
     {
-    OstTraceFunctionEntry0( REF_TUSBBATTERYCHARGINGPLUGINSTATEBASE_MPSOIDPINSTATECHANGED_ENTRY );
-
-    OstTrace1( TRACE_NORMAL, REF_TUSBBATTERYCHARGINGPLUGINSTATEBASE_MPSOIDPINSTATECHANGED, "TUsbBatteryChargingPluginStateBase::MpsoIdPinStateChanged;IdPinState changed => %d", aValue );
+    LOG_FUNC
+    
+    LOGTEXT2(_L8("IdPinState changed => %d"), aValue);
     
     // Disable charging here when IdPin is present
     // When IdPin disappears (i.e. the phone becomes B-Device), all necessary step are performed 
@@ -137,7 +127,6 @@
             TRAP_IGNORE(iParent.SetInitialConfigurationL());
             iParent.SetState(EPluginStateBEndedCableNotPresent);
             
-            OstTraceFunctionExit0( REF_TUSBBATTERYCHARGINGPLUGINSTATEBASE_MPSOIDPINSTATECHANGED_EXIT );
             return;
 
         case EUsbBatteryChargingIdPinBRole:
@@ -152,32 +141,29 @@
             iParent.SetState(EPluginStateIdle);
             break;
         }
-    OstTraceFunctionExit0( REF_TUSBBATTERYCHARGINGPLUGINSTATEBASE_MPSOIDPINSTATECHANGED_EXIT_DUP1 );
     }
 
 void TUsbBatteryChargingPluginStateBase::MpsoOtgStateChangedL(TUsbOtgState aNewState)
     {
-    OstTraceFunctionEntry0( REF_TUSBBATTERYCHARGINGPLUGINSTATEBASE_MPSOOTGSTATECHANGEDL_ENTRY );
+    LOG_FUNC
     
     iParent.iOtgState = aNewState;
     
     // Not use currently
-    OstTraceFunctionExit0( REF_TUSBBATTERYCHARGINGPLUGINSTATEBASE_MPSOOTGSTATECHANGEDL_EXIT );
     }
 #endif
 
 void TUsbBatteryChargingPluginStateBase::MpsoVBusStateChanged(TInt aNewState)
     {
-    OstTraceFunctionEntry0( REF_TUSBBATTERYCHARGINGPLUGINSTATEBASE_MPSOVBUSSTATECHANGED_ENTRY );
+    LOG_FUNC
     
     if (aNewState == iParent.iVBusState)
         {
-        OstTrace1( TRACE_NORMAL, REF_TUSBBATTERYCHARGINGPLUGINSTATEBASE_MPSOVBUSSTATECHANGED, "TUsbBatteryChargingPluginStateBase::MpsoVBusStateChanged;Receive VBus State Change notification without any state change: aNewState = %d", aNewState );
-        OstTraceFunctionExit0( REF_TUSBBATTERYCHARGINGPLUGINSTATEBASE_MPSOVBUSSTATECHANGED_EXIT );
+        LOGTEXT2(_L8("Receive VBus State Change notification without any state change: aNewState = %d"), aNewState);
         return;//should not happen??
         }
 
-    OstTraceExt2( TRACE_NORMAL, REF_TUSBBATTERYCHARGINGPLUGINSTATEBASE_MPSOVBUSSTATECHANGED_DUP1, "TUsbBatteryChargingPluginStateBase::MpsoVBusStateChanged;VBusState changed from %d to %d", iParent.iVBusState, aNewState );
+    LOGTEXT3(_L8("VBusState changed from %d to %d"), iParent.iVBusState, aNewState);
     
     iParent.iVBusState = aNewState;
     if (aNewState == 0) // VBus drop down - we have disconnected from host
@@ -190,7 +176,6 @@
         }
     
     // The handling of VBus on will be down in DeviceStateChanged implicitly
-    OstTraceFunctionExit0( REF_TUSBBATTERYCHARGINGPLUGINSTATEBASE_MPSOVBUSSTATECHANGED_EXIT_DUP1 );
     }
 
 
@@ -198,8 +183,7 @@
         CUsbBatteryChargingPlugin& aParentStateMachine ): 
         iParent(aParentStateMachine)
     {
-    OstTraceFunctionEntry0( REF_TUSBBATTERYCHARGINGPLUGINSTATEBASE_TUSBBATTERYCHARGINGPLUGINSTATEBASE_CONS_ENTRY );
-    OstTraceFunctionExit0( REF_TUSBBATTERYCHARGINGPLUGINSTATEBASE_TUSBBATTERYCHARGINGPLUGINSTATEBASE_CONS_EXIT );
+    LOG_FUNC
     }
 
         
@@ -209,16 +193,15 @@
         CUsbBatteryChargingPlugin& aParentStateMachine ) :
     TUsbBatteryChargingPluginStateBase(aParentStateMachine)
     {
-    OstTraceFunctionEntry0( REF_TUSBBATTERYCHARGINGPLUGINSTATEIDLE_TUSBBATTERYCHARGINGPLUGINSTATEIDLE_CONS_ENTRY );
-    OstTraceFunctionExit0( REF_TUSBBATTERYCHARGINGPLUGINSTATEIDLE_TUSBBATTERYCHARGINGPLUGINSTATEIDLE_CONS_EXIT );
+    LOG_FUNC
     };
 
 void TUsbBatteryChargingPluginStateIdle::UsbDeviceStateChange(
         TInt aLastError, TUsbDeviceState aOldState, TUsbDeviceState aNewState)
     {
-    OstTraceFunctionEntry0( REF_TUSBBATTERYCHARGINGPLUGINSTATEIDLE_USBDEVICESTATECHANGE_ENTRY );
+    LOG_FUNC
 
-    OstTraceExt3( TRACE_NORMAL, REF_TUSBBATTERYCHARGINGPLUGINSTATEIDLE_USBDEVICESTATECHANGE, "TUsbBatteryChargingPluginStateIdle::UsbDeviceStateChange;aLastError=%d;aOldState=%d;aNewState=%d", aLastError, aOldState, aNewState );
+    LOGTEXT4(_L8(">>TUsbBatteryChargingPluginStateIdle::UsbDeviceStateChange LastError = %d, aOldState = %d, aNewState = %d"), aLastError, aOldState, aNewState);
     (void)aLastError;
     (void)aOldState;
     iParent.iDeviceState = aNewState;
@@ -242,7 +225,6 @@
             }
             break;
         }
-    OstTraceFunctionExit0( REF_TUSBBATTERYCHARGINGPLUGINSTATEIDLE_USBDEVICESTATECHANGE_EXIT );
     }
     
     
@@ -252,16 +234,15 @@
         CUsbBatteryChargingPlugin& aParentStateMachine ) :
     TUsbBatteryChargingPluginStateBase(aParentStateMachine)
     {
-    OstTraceFunctionEntry0( REF_TUSBBATTERYCHARGINGPLUGINSTATECURRENTNEGOTIATING_TUSBBATTERYCHARGINGPLUGINSTATECURRENTNEGOTIATING_CONS_ENTRY );
-    OstTraceFunctionExit0( REF_TUSBBATTERYCHARGINGPLUGINSTATECURRENTNEGOTIATING_TUSBBATTERYCHARGINGPLUGINSTATECURRENTNEGOTIATING_CONS_EXIT );
+    LOG_FUNC
     };
     
 void TUsbBatteryChargingPluginStateCurrentNegotiating::UsbDeviceStateChange(
         TInt aLastError, TUsbDeviceState aOldState, TUsbDeviceState aNewState)
     {
-    OstTraceFunctionEntry0( REF_TUSBBATTERYCHARGINGPLUGINSTATECURRENTNEGOTIATING_USBDEVICESTATECHANGE_ENTRY );
+    LOG_FUNC
 
-    OstTraceExt3( TRACE_NORMAL, REF_TUSBBATTERYCHARGINGPLUGINSTATECURRENTNEGOTIATING_USBDEVICESTATECHANGE, "TUsbBatteryChargingPluginStateCurrentNegotiating::UsbDeviceStateChange;aLastError=%d;aOldState=%d;aNewState=%d", aLastError, aOldState, aNewState );
+    LOGTEXT4(_L8(">>TUsbBatteryChargingPluginStateCurrentNegotiating::UsbDeviceStateChange LastError = %d, aOldState = %d, aNewState = %d"), aLastError, aOldState, aNewState);
     (void)aLastError;
     (void)aOldState;
     iParent.iDeviceState = aNewState;
@@ -274,7 +255,7 @@
                 {
                 iParent.iDeviceStateTimer->Cancel();
                 
-                OstTrace1( TRACE_NORMAL, REF_TUSBBATTERYCHARGINGPLUGINSTATECURRENTNEGOTIATING_USBDEVICESTATECHANGE_DUP1, "TUsbBatteryChargingPluginStateCurrentNegotiating::UsbDeviceStateChange;iParent.iAvailableMilliAmps=%d", iParent.iAvailableMilliAmps );
+                LOGTEXT2(_L8("iParent.iAvailableMilliAmps = %d"),iParent.iAvailableMilliAmps);
                 iParent.iAvailableMilliAmps = iParent.iRequestedCurrentValue;
                 
                 if(0 != iParent.iRequestedCurrentValue)
@@ -282,7 +263,7 @@
                     // A non-zero value was accepted by host, charging 
                     // can be performed now.
                     iParent.StartCharging(iParent.iAvailableMilliAmps);                     
-                    OstTrace1( TRACE_NORMAL, REF_TUSBBATTERYCHARGINGPLUGINSTATECURRENTNEGOTIATING_USBDEVICESTATECHANGE_DUP2, "TUsbBatteryChargingPluginStateCurrentNegotiating::UsbDeviceStateChange;PluginState => EPluginStateCharging(%d)", iParent.iPluginState );
+                    LOGTEXT2(_L8("PluginState => EPluginStateCharging(%d)"),iParent.iPluginState);
                     iParent.SetNegotiatedCurrent(iParent.iAvailableMilliAmps);
                     }
                 else
@@ -290,7 +271,7 @@
                     // Host can only accept 0 charging current
                     // No way to do charging
                     iParent.SetState(EPluginStateNoValidCurrent);
-                    OstTrace1( TRACE_NORMAL, REF_TUSBBATTERYCHARGINGPLUGINSTATECURRENTNEGOTIATING_USBDEVICESTATECHANGE_DUP3, "TUsbBatteryChargingPluginStateCurrentNegotiating::UsbDeviceStateChange;No more current value to try, iPluginState turned to %d", iParent.iPluginState );
+                    LOGTEXT2(_L8("No more current value to try, iPluginState turned to %d"), iParent.iPluginState);
                     }
                 }
             
@@ -304,13 +285,12 @@
         default:
             break;
         }
-    OstTraceFunctionExit0( REF_TUSBBATTERYCHARGINGPLUGINSTATECURRENTNEGOTIATING_USBDEVICESTATECHANGE_EXIT );
     }
 
 void TUsbBatteryChargingPluginStateCurrentNegotiating::DeviceStateTimeout()
     {
-    OstTraceFunctionEntry0( REF_TUSBBATTERYCHARGINGPLUGINSTATECURRENTNEGOTIATING_DEVICESTATETIMEOUT_ENTRY );
-    OstTraceExt3( TRACE_NORMAL, REF_TUSBBATTERYCHARGINGPLUGINSTATECURRENTNEGOTIATING_DEVICESTATETIMEOUT, "TUsbBatteryChargingPluginStateCurrentNegotiating::DeviceStateTimeout;Time: %d Plugin State = %d, Device State = %d", User::NTickCount(), (TInt32)iParent.iPluginState, (TInt32)iParent.iDeviceState );
+    LOG_FUNC
+    LOGTEXT4(_L8("Time: %d Plugin State = %d, Device State = %d"), User::NTickCount(), iParent.iPluginState, iParent.iDeviceState);
     
     iParent.iDeviceReEnumerator->Cancel(); // cancel re-enumeration AO
     
@@ -325,7 +305,6 @@
         // Assume it will never happens.
         iParent.SetState(EPluginStateNoValidCurrent);
         }
-    OstTraceFunctionExit0( REF_TUSBBATTERYCHARGINGPLUGINSTATECURRENTNEGOTIATING_DEVICESTATETIMEOUT_EXIT );
     }
 
 
@@ -336,16 +315,15 @@
         CUsbBatteryChargingPlugin& aParentStateMachine ) :
     TUsbBatteryChargingPluginStateBase(aParentStateMachine)
     {
-    OstTraceFunctionEntry0( REF_TUSBBATTERYCHARGINGPLUGINSTATECHARGING_TUSBBATTERYCHARGINGPLUGINSTATECHARGING_CONS_ENTRY );
-    OstTraceFunctionExit0( REF_TUSBBATTERYCHARGINGPLUGINSTATECHARGING_TUSBBATTERYCHARGINGPLUGINSTATECHARGING_CONS_EXIT );
+    LOG_FUNC
     }
 
 void TUsbBatteryChargingPluginStateCharging::UsbDeviceStateChange(
         TInt aLastError, TUsbDeviceState aOldState, TUsbDeviceState aNewState)
     {
-    OstTraceFunctionEntry0( REF_TUSBBATTERYCHARGINGPLUGINSTATECHARGING_USBDEVICESTATECHANGE_ENTRY );
+    LOG_FUNC
 
-    OstTraceExt3( TRACE_NORMAL, REF_TUSBBATTERYCHARGINGPLUGINSTATECHARGING_USBDEVICESTATECHANGE, "TUsbBatteryChargingPluginStateCharging::UsbDeviceStateChange;aLastError=%d;aOldState=%d;aNewState=%d", aLastError, aOldState, aNewState );
+    LOGTEXT4(_L8(">>TUsbBatteryChargingPluginStateCharging::UsbDeviceStateChange LastError = %d, aOldState = %d, aNewState = %d"), aLastError, aOldState, aNewState);
     (void)aLastError;
     (void)aOldState;
     iParent.iDeviceState = aNewState;
@@ -371,7 +349,6 @@
         default:
             break;
         }
-    OstTraceFunctionExit0( REF_TUSBBATTERYCHARGINGPLUGINSTATECHARGING_USBDEVICESTATECHANGE_EXIT );
     }
 
 // Charging plugin negotiated fail state
@@ -381,8 +358,7 @@
         CUsbBatteryChargingPlugin& aParentStateMachine ) :
     TUsbBatteryChargingPluginStateBase(aParentStateMachine)
     {
-    OstTraceFunctionEntry0( REF_TUSBBATTERYCHARGINGPLUGINSTATENOVALIDCURRENT_TUSBBATTERYCHARGINGPLUGINSTATENOVALIDCURRENT_CONS_ENTRY );
-    OstTraceFunctionExit0( REF_TUSBBATTERYCHARGINGPLUGINSTATENOVALIDCURRENT_TUSBBATTERYCHARGINGPLUGINSTATENOVALIDCURRENT_CONS_EXIT );
+    LOG_FUNC
     };
 
     
@@ -392,16 +368,15 @@
         CUsbBatteryChargingPlugin& aParentStateMachine ) :
     TUsbBatteryChargingPluginStateBase(aParentStateMachine)
     {
-    OstTraceFunctionEntry0( REF_TUSBBATTERYCHARGINGPLUGINSTATEIDLENEGOTIATED_TUSBBATTERYCHARGINGPLUGINSTATEIDLENEGOTIATED_CONS_ENTRY );
-    OstTraceFunctionExit0( REF_TUSBBATTERYCHARGINGPLUGINSTATEIDLENEGOTIATED_TUSBBATTERYCHARGINGPLUGINSTATEIDLENEGOTIATED_CONS_EXIT );
+    LOG_FUNC
     };
 
 void TUsbBatteryChargingPluginStateIdleNegotiated::UsbDeviceStateChange(
         TInt aLastError, TUsbDeviceState aOldState, TUsbDeviceState aNewState)
     {
-    OstTraceFunctionEntry0( REF_TUSBBATTERYCHARGINGPLUGINSTATEIDLENEGOTIATED_USBDEVICESTATECHANGE_ENTRY );
+    LOG_FUNC
 
-    OstTraceExt3( TRACE_NORMAL, REF_TUSBBATTERYCHARGINGPLUGINSTATEIDLENEGOTIATED_USBDEVICESTATECHANGE, "TUsbBatteryChargingPluginStateIdleNegotiated::UsbDeviceStateChange;aLastError=%d;aOldState=%d;aNewState=%d", aLastError, aOldState, aNewState );
+    LOGTEXT4(_L8(">>TUsbBatteryChargingPluginStateIdleNegotiated::UsbDeviceStateChange LastError = %d, aOldState = %d, aNewState = %d"), aLastError, aOldState, aNewState);
     (void)aLastError;
     (void)aOldState;
     iParent.iDeviceState = aNewState;
@@ -422,7 +397,6 @@
         default:
             break;
         }
-    OstTraceFunctionExit0( REF_TUSBBATTERYCHARGINGPLUGINSTATEIDLENEGOTIATED_USBDEVICESTATECHANGE_EXIT );
     }
  
 // Charging plugin user disabled state
@@ -431,32 +405,29 @@
         CUsbBatteryChargingPlugin& aParentStateMachine ) :
     TUsbBatteryChargingPluginStateBase(aParentStateMachine)
     {
-    OstTraceFunctionEntry0( REF_TUSBBATTERYCHARGINGPLUGINSTATEUSERDISABLED_TUSBBATTERYCHARGINGPLUGINSTATEUSERDISABLED_CONS_ENTRY );
-    OstTraceFunctionExit0( REF_TUSBBATTERYCHARGINGPLUGINSTATEUSERDISABLED_TUSBBATTERYCHARGINGPLUGINSTATEUSERDISABLED_CONS_EXIT );
+    LOG_FUNC
     };
 
 
 void TUsbBatteryChargingPluginStateUserDisabled::UsbDeviceStateChange(
         TInt aLastError, TUsbDeviceState aOldState, TUsbDeviceState aNewState)
     {
-    OstTraceFunctionEntry0( REF_TUSBBATTERYCHARGINGPLUGINSTATEUSERDISABLED_USBDEVICESTATECHANGE_ENTRY );
+    LOG_FUNC
 
-    OstTraceExt3( TRACE_NORMAL, REF_TUSBBATTERYCHARGINGPLUGINSTATEUSERDISABLED_USBDEVICESTATECHANGE, "TUsbBatteryChargingPluginStateUserDisabled::UsbDeviceStateChange;aLastError=%d;aOldState=%d;aNewState=%d", aLastError, aOldState, aNewState );
+    LOGTEXT4(_L8(">>TUsbBatteryChargingPluginStateUserDisabled::UsbDeviceStateChange LastError = %d, aOldState = %d, aNewState = %d"), aLastError, aOldState, aNewState);
     (void)aLastError;
     (void)aOldState;
     iParent.iDeviceState = aNewState;
     iParent.LogStateText(aNewState);
-    OstTraceFunctionExit0( REF_TUSBBATTERYCHARGINGPLUGINSTATEUSERDISABLED_USBDEVICESTATECHANGE_EXIT );
     }
 
 void TUsbBatteryChargingPluginStateUserDisabled::HandleRepositoryValueChangedL(
     const TUid& aRepository, TUint aId, TInt aVal)
     {
-    OstTraceFunctionEntry0( REF_TUSBBATTERYCHARGINGPLUGINSTATEUSERDISABLED_HANDLEREPOSITORYVALUECHANGEDL_ENTRY );
+    LOG_FUNC
     
-    OstTrace1( TRACE_NORMAL, REF_TUSBBATTERYCHARGINGPLUGINSTATEUSERDISABLED_HANDLEREPOSITORYVALUECHANGEDL, "TUsbBatteryChargingPluginStateUserDisabled::HandleRepositoryValueChangedL;aRepository = 0x%08x", aRepository.iUid );
-    OstTraceExt2( TRACE_NORMAL, REF_TUSBBATTERYCHARGINGPLUGINSTATEUSERDISABLED_HANDLEREPOSITORYVALUECHANGEDL_DUP1, "TUsbBatteryChargingPluginStateUserDisabled::HandleRepositoryValueChangedL;aId=%d;aVal=%d", aId, aVal );
-    OstTraceExt2( TRACE_NORMAL, REF_TUSBBATTERYCHARGINGPLUGINSTATEUSERDISABLED_HANDLEREPOSITORYVALUECHANGEDL_DUP2, "TUsbBatteryChargingPluginStateUserDisabled::HandleRepositoryValueChangedL;iParent.iPluginState=%d;iParent.iDeviceState=%d", iParent.iPluginState, iParent.iDeviceState );
+    LOGTEXT4(_L8(">>TUsbBatteryChargingPluginStateUserDisabled::HandleRepositoryValueChangedL aRepository = 0x%08x, aId = %d, aVal = %d"), aRepository, aId, aVal);
+    LOGTEXT3(_L8("Plugin State = %d, Device State = %d"), iParent.iPluginState, iParent.iDeviceState);
     
     if ((aRepository == KUsbBatteryChargingCentralRepositoryUid) &&
             (aId == KUsbBatteryChargingKeyEnabledUserSetting))
@@ -472,19 +443,18 @@
                 {
                 iParent.StartCharging(iParent.iAvailableMilliAmps); // Go to charing state implicitly
                 }
-            OstTrace1( TRACE_NORMAL, REF_TUSBBATTERYCHARGINGPLUGINSTATEUSERDISABLED_HANDLEREPOSITORYVALUECHANGEDL_DUP3, "TUsbBatteryChargingPluginStateUserDisabled::HandleRepositoryValueChangedL;PluginState => %d", iParent.iPluginState );
+            LOGTEXT2(_L8("PluginState => %d"), iParent.iPluginState);
             }
         }
-    OstTraceFunctionExit0( REF_TUSBBATTERYCHARGINGPLUGINSTATEUSERDISABLED_HANDLEREPOSITORYVALUECHANGEDL_EXIT );
     }
 
 // For host OTG enabled charging plug-in
 #ifdef SYMBIAN_ENABLE_USB_OTG_HOST_PRIV
 void TUsbBatteryChargingPluginStateUserDisabled::MpsoIdPinStateChanged(TInt aValue)
     {
-    OstTraceFunctionEntry0( REF_TUSBBATTERYCHARGINGPLUGINSTATEUSERDISABLED_MPSOIDPINSTATECHANGED_ENTRY );
+    LOG_FUNC
     
-    OstTrace1( TRACE_NORMAL, REF_TUSBBATTERYCHARGINGPLUGINSTATEUSERDISABLED_MPSOIDPINSTATECHANGED, "TUsbBatteryChargingPluginStateUserDisabled::MpsoIdPinStateChanged;IdPinState changed => %d", aValue );
+    LOGTEXT2(_L8("IdPinState changed => %d"), aValue);
     
     // Disable charging here when IdPin is present
     // When IdPin disappears (i.e. the phone becomes B-Device), all necessary step are performed 
@@ -498,7 +468,6 @@
             TRAP_IGNORE(iParent.SetInitialConfigurationL());
             iParent.PushRecoverState(EPluginStateBEndedCableNotPresent);
             
-            OstTraceFunctionExit0( REF_TUSBBATTERYCHARGINGPLUGINSTATEUSERDISABLED_MPSOIDPINSTATECHANGED_EXIT );
             return;
 
         case EUsbBatteryChargingIdPinBRole:
@@ -509,23 +478,21 @@
             iParent.SetState(EPluginStateIdle);
             break;
         }
-    OstTraceFunctionExit0( REF_TUSBBATTERYCHARGINGPLUGINSTATEUSERDISABLED_MPSOIDPINSTATECHANGED_EXIT_DUP1 );
     }
 
 #endif     
  
 void TUsbBatteryChargingPluginStateUserDisabled::MpsoVBusStateChanged(TInt aNewState)
     {
-    OstTraceFunctionEntry0( REF_TUSBBATTERYCHARGINGPLUGINSTATEUSERDISABLED_MPSOVBUSSTATECHANGED_ENTRY );
+    LOG_FUNC
     
     if (aNewState == iParent.iVBusState)
         {
-        OstTrace1( TRACE_NORMAL, REF_TUSBBATTERYCHARGINGPLUGINSTATEUSERDISABLED_MPSOVBUSSTATECHANGED, "TUsbBatteryChargingPluginStateUserDisabled::MpsoVBusStateChanged;Receive VBus State Change notification without any state change: aNewState = %d", aNewState );
-        OstTraceFunctionExit0( REF_TUSBBATTERYCHARGINGPLUGINSTATEUSERDISABLED_MPSOVBUSSTATECHANGED_EXIT );
+        LOGTEXT2(_L8("Receive VBus State Change notification without any state change: aNewState = %d"), aNewState);
         return;
         }
 
-    OstTraceExt2( TRACE_NORMAL, REF_TUSBBATTERYCHARGINGPLUGINSTATEUSERDISABLED_MPSOVBUSSTATECHANGED_DUP1, "TUsbBatteryChargingPluginStateUserDisabled::MpsoVBusStateChanged;VBusState changed from %d to %d", iParent.iVBusState, aNewState );
+    LOGTEXT3(_L8("VBusState changed from %d to %d"), iParent.iVBusState, aNewState);
     
     iParent.iVBusState = aNewState;
     if (aNewState == 0) // VBus drop down - we have disconnected from host
@@ -538,7 +505,6 @@
         }
     
     // The handling of VBus on will be down in DeviceStateChanged implicitly
-    OstTraceFunctionExit0( REF_TUSBBATTERYCHARGINGPLUGINSTATEUSERDISABLED_MPSOVBUSSTATECHANGED_EXIT_DUP1 );
     }
 
 
@@ -548,8 +514,7 @@
         CUsbBatteryChargingPlugin& aParentStateMachine ) :
     TUsbBatteryChargingPluginStateBase(aParentStateMachine)
     {
-    OstTraceFunctionEntry0( RES_TUSBBATTERYCHARGINGPLUGINSTATEBENDEDCABLENOTPRESENT_TUSBBATTERYCHARGINGPLUGINSTATEBENDEDCABLENOTPRESENT_CONS_ENTRY );
-    OstTraceFunctionExit0( RES_TUSBBATTERYCHARGINGPLUGINSTATEBENDEDCABLENOTPRESENT_TUSBBATTERYCHARGINGPLUGINSTATEBENDEDCABLENOTPRESENT_CONS_EXIT );
+    LOG_FUNC
     };