datacommsserver/esockserver/ssock/ss_log.cpp
changeset 0 dfb7c4ff071f
child 9 77effd21b2c9
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include <e32std.h>
       
    17 #include <ss_glob.h>
       
    18 #include <comms-infras/ss_log.h>
       
    19 #include <comms-infras/nifif.h>
       
    20 #include <comms-infras/ss_thread.h>
       
    21 #include <comms-infras/sockmes.h>
       
    22 #include <comms-infras/ss_nodemessages.h>
       
    23 #include <comms-infras/ss_mcprnodemessages.h>
       
    24 
       
    25 #if defined (__CFLOG_ACTIVE) || defined (SYMBIAN_TRACE_ENABLE)
       
    26 
       
    27 
       
    28 using namespace ESock;
       
    29 
       
    30 EXPORT_C void ESockLogExternal::Printf(const TDesC8& aMajorTag, const TDesC8& aSubTag, TRefByValue<const TDesC8> aFmt, ...)
       
    31 	{
       
    32 	VA_LIST list;
       
    33 	VA_START(list,aFmt);
       
    34 	Printf(aMajorTag, aSubTag, aFmt, list);
       
    35 	VA_END(list);
       
    36 	}
       
    37 
       
    38 EXPORT_C void ESockLogExternal::Printf(const TDesC8& aMajorTag, const TDesC8& aSubTag, TRefByValue<const TDesC8> aFmt, VA_LIST& aList)
       
    39 	{
       
    40 	TBuf8<200> buf;
       
    41 	CSockManData* globs = SockManGlobals::Get();
       
    42 	if(globs)
       
    43 		{
       
    44 		CWorkerThread* worker = globs->SelfWorker();
       
    45 		if(worker)
       
    46 			{
       
    47 			_LIT8(KWorkerIdFormat, "W%d: ");
       
    48 			buf.Format(KWorkerIdFormat, worker->WorkerId());
       
    49 			}
       
    50 		}
       
    51 	TLogIgnoreOverflow8 overflowHandler;
       
    52 	buf.AppendFormatList(aFmt, aList, &overflowHandler);
       
    53 	
       
    54 #ifdef SYMBIAN_TRACE_ENABLE
       
    55     const TInt KSimpleLoggingPrimaryFilter = 196;
       
    56 	UTracePfAny(KSimpleLoggingPrimaryFilter, KText, ETrue, EFalse, 0, buf.Ptr(), buf.Length());
       
    57 #endif
       
    58 
       
    59 #ifdef __CFLOG_ACTIVE
       
    60 	CCFLogIf::WriteFormat(aMajorTag, aSubTag, buf);
       
    61 #else
       
    62 	// Preventing unused variable warnings.
       
    63 	(void)aMajorTag;
       
    64 	(void)aSubTag;
       
    65 #endif	
       
    66 	}
       
    67 
       
    68 
       
    69 void ESockLog::Printf(TRefByValue<const TDesC8> aFmt,...)
       
    70 /**
       
    71 Write a multiple argument list to the log using the generc server tag, trapping and ignoring any leave
       
    72 
       
    73 */
       
    74 	{
       
    75 	VA_LIST list;
       
    76 	VA_START(list,aFmt);
       
    77 	ESockLogExternal::Printf(KESockComponentTag, KESockServerTag, aFmt, list);
       
    78 	VA_END(list);
       
    79 	}
       
    80 
       
    81 void ESockLog::Printf(TRefByValue<const TDesC> aFmt,...)
       
    82 /**
       
    83 Write a multiple argument list to the log, trapping and ignoring any leave
       
    84 
       
    85 */
       
    86 	{
       
    87 	VA_LIST list;
       
    88 	VA_START(list,aFmt);
       
    89 	Printf(KESockComponentTag, KESockServerTag, aFmt, list);
       
    90 	VA_END(list);
       
    91 	}
       
    92 
       
    93 void ESockLog::Printf(const TDesC8& aSubTag, TRefByValue<const TDesC8> aFmt, ...)
       
    94 	{
       
    95 	VA_LIST list;
       
    96 	VA_START(list,aFmt);
       
    97 	ESockLogExternal::Printf(KESockComponentTag, aSubTag, aFmt, list);
       
    98 	VA_END(list);
       
    99 	}
       
   100 
       
   101 void ESockLog::Printf(const TDesC8& aSubTag, TRefByValue<const TDesC> aFmt, ...)
       
   102 	{
       
   103 	VA_LIST list;
       
   104 	VA_START(list,aFmt);
       
   105 	Printf(KESockComponentTag, aSubTag, aFmt, list);
       
   106 	VA_END(list);
       
   107 	}
       
   108 	
       
   109 void ESockLog::Printf(const TDesC8& aSubTag, TRefByValue<const TDesC> aFmt, VA_LIST& aList)
       
   110 	{
       
   111 	Printf(KESockComponentTag, aSubTag, aFmt, aList);
       
   112 	}
       
   113 
       
   114 
       
   115 void ESockLog::Printf(const TDesC8& aMajorTag, const TDesC8& aSubTag, TRefByValue<const TDesC> aFmt, VA_LIST& aList)
       
   116 /**
       
   117 Write a multiple argument list to the log, trapping and ignoring any leave
       
   118 
       
   119 */
       
   120 	{
       
   121 	TBuf<200> buf;
       
   122 	CSockManData* globs = SockManGlobals::Get();
       
   123 	if(globs)
       
   124 		{
       
   125 		CWorkerThread* worker = globs->SelfWorker();
       
   126 		if(worker)
       
   127 			{
       
   128 			_LIT(KWorkerIdFormat, "W%d: ");
       
   129 			buf.Format(KWorkerIdFormat, worker->WorkerId());
       
   130 			}
       
   131 		}
       
   132 	TLogIgnoreOverflow16 overflowHandler;
       
   133 	buf.AppendFormatList(aFmt, aList, &overflowHandler);
       
   134 	
       
   135 #ifdef SYMBIAN_TRACE_ENABLE
       
   136     const TInt KSimpleLoggingPrimaryFilter = 196;
       
   137     TBuf8<200> buf8;
       
   138     buf8.Copy(buf);
       
   139 	UTracePfAny(KSimpleLoggingPrimaryFilter, KText, ETrue, EFalse, 0, buf8.Ptr(), buf8.Length());
       
   140 #endif
       
   141 
       
   142 #ifdef __CFLOG_ACTIVE	
       
   143 	CCFLogIf::Write(aMajorTag, aSubTag, buf);
       
   144 #else
       
   145 	// Preventing unused variable warnings.
       
   146 	(void)aMajorTag;
       
   147 	(void)aSubTag;
       
   148 #endif	
       
   149 	}
       
   150 	
       
   151 void ESockLog::Printf(const TDesC8& aSubTag, TRefByValue<const TDesC8> aFmt, VA_LIST& aList)
       
   152 	{
       
   153 	ESockLogExternal::Printf(KESockComponentTag, aSubTag, aFmt, aList);
       
   154 	}
       
   155 
       
   156 void ESockLog::ConnectionInfoPrintf(const TDesC8& aConnectionInfo, TRefByValue<const TDesC> aFmt,...)
       
   157 /**
       
   158 Write a multiple argument list to the log, trapping and ignoring any leave
       
   159 */
       
   160 	{
       
   161 	VA_LIST list;
       
   162 	VA_START(list,aFmt);
       
   163 	TBuf<200> buf;
       
   164 	buf.AppendFormatList(aFmt, list);
       
   165 	const TSoIfConnectionInfo *info = REINTERPRET_CAST(const TSoIfConnectionInfo*, aConnectionInfo.Ptr());
       
   166 	buf.AppendFormat(_L(" IAP %d, Network %d"), info->iIAPId, info->iNetworkId);
       
   167 	
       
   168 #ifdef SYMBIAN_TRACE_ENABLE
       
   169     const TInt KSimpleLoggingPrimaryFilter = 196;
       
   170     TBuf8<200> buf8;
       
   171     buf8.Copy(buf);
       
   172 	UTracePfAny(KSimpleLoggingPrimaryFilter, KText, ETrue, EFalse, 0, buf8.Ptr(), buf8.Length());
       
   173 #endif
       
   174 
       
   175 #ifdef __CFLOG_ACTIVE
       
   176 	CCFLogIf::Write(KESockComponentTag, KESockConnectionTag, buf);
       
   177 #endif
       
   178 	
       
   179 	VA_END(list);
       
   180 	}
       
   181 
       
   182 
       
   183 const TText8* ESockLog::IPCMessName(TSockMess aMess)
       
   184 /**
       
   185 Write a multiple argument list to the log, trapping and ignoring any leave
       
   186 */
       
   187 	{
       
   188 	switch(aMess)
       
   189 		{
       
   190 		case ESSNumProtocols: return _S8("ESSNumProtocols");
       
   191 		case ESSProtocolInfo: return _S8("ESSProtocolInfo");
       
   192 		case ESSProtocolInfoByName: return _S8("ESSProtocolInfoByName");
       
   193 		case ESSProtocolStart: return _S8("ESSProtocolStart");
       
   194 		case ESSProtocolStop: return _S8("ESSProtocolStop");
       
   195 		case ESSInstallExtension: return _S8("ESSInstallExtension");
       
   196 		case ESoCreate: return _S8("ESoCreate");
       
   197 		case ESoCreateNull: return _S8("ESoCreateNull");
       
   198 		case ESoSend: return _S8("ESoSend");
       
   199 		case ESoSendNoLength: return _S8("ESoSendNoLength");
       
   200 		case ESoRecv: return _S8("ESoRecv");
       
   201 		case ESoRecvNoLength: return _S8("ESoRecvNoLength");
       
   202 		case ESoRecvOneOrMore: return _S8("ESoRecvOneOrMore");
       
   203 		case ESoRead: return _S8("ESoRead");
       
   204 		case ESoWrite: return _S8("ESoWrite");
       
   205 		case ESoSendTo: return _S8("ESoSendTo");
       
   206 		case ESoSendToNoLength: return _S8("ESoSendToNoLength");
       
   207 		case ESoRecvFrom: return _S8("ESoRecvFrom");
       
   208 		case ESoRecvFromNoLength: return _S8("ESoRecvFromNoLength");
       
   209 		case ESoConnect: return _S8("ESoConnect");
       
   210 		case ESoBind: return _S8("ESoBind");
       
   211 		case ESoAccept: return _S8("ESoAccept");
       
   212 		case ESoListen: return _S8("ESoListen");
       
   213 		case ESoSetOpt: return _S8("ESoSetOpt");
       
   214 		case ESoGetOpt: return _S8("ESoGetOpt");
       
   215 		case ESoIoctl: return _S8("ESoIoctl");
       
   216 		case ESoGetDiscData: return _S8("ESoGetDiscData");
       
   217 		case ESoGetLocalName: return _S8("ESoGetLocalName");
       
   218 		case ESoGetRemoteName: return _S8("ESoGetRemoteName");
       
   219 		case ESoClose: return _S8("ESoClose");
       
   220 		case ESoShutdown: return _S8("ESoShutdown");
       
   221 		case ESoCancelIoctl: return _S8("ESoCancelIoctl");
       
   222 		case ESoCancelRecv: return _S8("ESoCancelRecv");
       
   223 		case ESoCancelSend: return _S8("ESoCancelSend");
       
   224 		case ESoCancelConnect: return _S8("ESoCancelConnect");
       
   225 		case ESoCancelAccept: return _S8("ESoCancelAccept");
       
   226 		case ESoCancelAll: return _S8("ESoCancelAll");
       
   227 		case ESoSocketInfo: return _S8("ESoSocketInfo");
       
   228 		case ESoReference: return _S8("ESoReference");
       
   229 		case ESoTransfer: return _S8("ESoTransfer");
       
   230 		case EHRCreate: return _S8("EHRCreate");
       
   231 		case EHRGetByName: return _S8("EHRGetByName");
       
   232 		case EHRNext: return _S8("EHRNext");
       
   233 		case EHRGetByAddress: return _S8("EHRGetByAddress");
       
   234 		case EHRGetHostName: return _S8("EHRGetHostName");
       
   235 		case EHRSetHostName: return _S8("EHRSetHostName");
       
   236 		case EHRCancel: return _S8("EHRCancel");
       
   237 		case EHRClose: return _S8("EHRClose");
       
   238 		case ESRCreate: return _S8("ESRCreate");
       
   239 		case ESRGetByName: return _S8("ESRGetByName");
       
   240 		case ESRGetByNumber: return _S8("ESRGetByNumber");
       
   241 		case ESRRegisterService: return _S8("ESRRegisterService");
       
   242 		case ESRRemoveService: return _S8("ESRRemoveService");
       
   243 		case ESRCancel: return _S8("ESRCancel");
       
   244 		case ESRClose: return _S8("ESRClose");
       
   245 		case ENDCreate: return _S8("ENDCreate");
       
   246 		case ENDQuery: return _S8("ENDQuery");
       
   247 		case ENDAdd: return _S8("ENDAdd");
       
   248 		case ENDRemove: return _S8("ENDRemove");
       
   249 		case ENDCancel: return _S8("ENDCancel");
       
   250 		case ENDClose: return _S8("ENDClose");
       
   251 		case ESoCreateWithConnection: return _S8("ESoCreateWithConnection");
       
   252 		case EHRCreateWithConnection: return _S8("EHRCreateWithConnection");
       
   253 		case ECNCreate: return _S8("ECNCreate");
       
   254 		case ECNCreateWithName: return _S8("ECNCreateWithName");
       
   255 		case ECNClose: return _S8("ECNClose");
       
   256 		case ECNReference: return _S8("ECNReference");
       
   257 		case ECNStart: return _S8("ECNStart");
       
   258 		case ECNSetStartPrefs: return _S8("ECNSetStartPrefs");
       
   259 		case ECNStop: return _S8("ECNStop");
       
   260 		case ECNProgress: return _S8("ECNProgress");
       
   261 		case ECNProgressNotification: return _S8("ECNProgressNotification");
       
   262 		case ECNCancelProgressNotification: return _S8("ECNCancelProgressNotification");
       
   263 		case ECNLastProgressError: return _S8("ECNLastProgressError");
       
   264 		case ECNServiceChangeNotification: return _S8("ECNServiceChangeNotification");
       
   265 		case ECNCancelServiceChangeNotification: return _S8("ECNCancelServiceChangeNotification");
       
   266 		case ECNGetIntSetting: return _S8("ECNGetIntSetting");
       
   267 		case ECNGetBoolSetting: return _S8("ECNGetBoolSetting");
       
   268 		case ECNGetDes8Setting: return _S8("ECNGetDes8Setting");
       
   269 		case ECNGetDes16Setting: return _S8("ECNGetDes16Setting");
       
   270 		case ECNGetLongDesSetting: return _S8("ECNGetLongDesSetting");
       
   271 		case ECNEnumerateConnections: return _S8("ECNEnumerateConnections");
       
   272 		case ECNGetConnectionInfo: return _S8("ECNGetConnectionInfo");
       
   273 		case ECNControl: return _S8("ECNControl");
       
   274 		case ECNAttach: return _S8("ECNAttach");
       
   275 		case ECNAllInterfaceNotification: return _S8("ECNAllInterfaceNotification");
       
   276 		case ECNCancelAllInterfaceNotification: return _S8("ECNCancelAllInterfaceNotification");
       
   277 		case ESCPSStop: return _S8("ESCPSStop");
       
   278 		case ESCPSProgress: return _S8("ESCPSProgress");
       
   279 		case ESCPSProgressNotification: return _S8("ESCPSProgressNotification");
       
   280 		case ESCPSCancelProgressNotification: return _S8("ESCPSCancelProgressNotification");
       
   281 		case ECNEnumerateSubConnections: return _S8("ECNEnumerateSubConnections");
       
   282 		case ESCPSGetSubConnectionInfo: return _S8("ESCPSGetSubConnectionInfo");
       
   283 		case ECNAllSubConnectionNotification: return _S8("ECNAllSubConnectionNotification");
       
   284 		case ECNCancelAllSubConnectionNotification: return _S8("ECNCancelAllSubConnectionNotification");
       
   285 		case ESCPSDataTransferred: return _S8("ESCPSDataTransferred");
       
   286 		case ESCPSDataTransferredCancel: return _S8("ESCPSDataTransferredCancel");
       
   287 		case ESCPSDataSentNotificationRequest: return _S8("ESCPSDataSentNotificationRequest");
       
   288 		case ESCPSDataSentNotificationCancel: return _S8("ESCPSDataSentNotificationCancel");
       
   289 		case ESCPSDataReceivedNotificationRequest: return _S8("ESCPSDataReceivedNotificationRequest");
       
   290 		case ESCPSDataReceivedNotificationCancel: return _S8("ESCPSDataReceivedNotificationCancel");
       
   291 		case ESCPSIsSubConnectionActiveRequest: return _S8("ESCPSIsSubConnectionActiveRequest");
       
   292 		case ESCPSIsSubConnectionActiveCancel: return _S8("ESCPSIsSubConnectionActiveCancel");
       
   293 		case ESCCreate: return _S8("ESCCreate");
       
   294 		case ESCProgressNotification: return _S8("ESCProgressNotification");
       
   295 		case ESCCancelProgressNotification: return _S8("ESCCancelProgressNotification");
       
   296 		case ESCProgress: return _S8("ESCProgress");
       
   297 		case ESCIsSubConnectionActiveRequest: return _S8("ESCIsSubConnectionActiveRequest");
       
   298 		case ESCIsSubConnectionActiveCancel: return _S8("ESCIsSubConnectionActiveCancel");
       
   299 		case ESCClose: return _S8("ESCClose");
       
   300 		case ESCAddSocket: return _S8("ESCAddSocket");
       
   301 		case ESCRemoveSocket: return _S8("ESCRemoveSocket");
       
   302 		case ESCSetParameters: return _S8("ESCSetParameters");
       
   303 		case ESCGetParameters: return _S8("ESCGetParameters");
       
   304 		case ESCGetParametersLength: return _S8("ESCGetParametersLength");
       
   305 		case ESCEventNotification: return _S8("ESCEventNotification");
       
   306 		case ESCEventNotificationCancel: return _S8("ESCEventNotificationCancel");
       
   307 		case ESCControl: return _S8("ESCControl");
       
   308 		case ESoCreateWithSubConnection: return _S8("ESoCreateWithSubConnection");
       
   309 		case ESSDbgMarkHeap: return _S8("ESSDbgMarkHeap");
       
   310 		case ESSDbgCheckHeap: return _S8("ESSDbgCheckHeap");
       
   311 		case ESSDbgMarkEnd: return _S8("ESSDbgMarkEnd");
       
   312 		case ESSDbgFailNext: return _S8("ESSDbgFailNext");
       
   313 		case ESSDbgCheckFailNext: return _S8("ESSDbgCheckFailNext");
       
   314 		case ESSDbgFailNextMbuf: return _S8("ESSDbgFailNextMbuf");
       
   315 		case ESSDbgSetMbufPoolLimit: return _S8("ESSDbgSetMbufPoolLimit");
       
   316 		case ESSDbgCheckMbuf: return _S8("ESSDbgCheckMbuf");
       
   317 		case ESSDbgMbufFreeSpace: return _S8("ESSDbgMbufFreeSpace");
       
   318 		case ESSDbgMbufTotalSpace: return _S8("ESSDbgMbufTotalSpace");
       
   319 
       
   320 		case ESSDbgControl: return _S8("ESSDbgControl");
       
   321 
       
   322 		case ESSExclusiveMode: return _S8("ESSExclusiveMode");
       
   323 		case ESSClearExclusiveMode: return _S8("ESSClearExclusiveMode");
       
   324 		case EHrQuery: return _S8("EHrQuery");
       
   325 		case EHrQueryNext: return _S8("EHrQueryNext");
       
   326 		case ECNIoctl: return _S8("ECNIoctl");
       
   327 		case ECNCancelIoctl: return _S8("ECNCancelIoctl");
       
   328 		case ESSRequestOptimalDealer: return _S8("ESSRequestOptimalDealer");
       
   329 		case ECommsApiExtBindIface: return _S8("ECommsApiExtBindIface");
       
   330 		case ECommsApiExtIfaceSendReceive: return _S8("ECommsApiExtIfaceSendReceive");
       
   331 		case ECommsApiExtIfaceSend: return _S8("ECommsApiExtIfaceSend");
       
   332 		case ECommsApiExtIfaceClose: return _S8("ECommsApiExtIfaceClose");
       
   333 		case ECNWaitForIncoming: return _S8("ECNWaitForIncoming");
       
   334 		case ECNCancelWaitForIncoming: return _S8("ECNCancelWaitForIncoming");
       
   335 		case ESCStart: return _S8("ESCStart");
       
   336 		case ESCStop: return _S8("ESCStop");
       
   337 		case ESCEventAllNotifications: return _S8("ESCEventAllNotifications");
       
   338 		case ESCEventNotificationSetup: return _S8("ESCEventNotificationSetup");
       
   339 		case ECNGetOrSetParameters: return _S8("ECNGetOrSetParameters");
       
   340 		case ECNGetParametersResponseLength: return _S8("ECNGetParametersResponseLength");
       
   341 		case ECNGetParametersResponse: return _S8("ECNGetParametersResponse");
       
   342 		case EHRSetOpt: return _S8("EHRSetOpt");
       
   343 
       
   344 		default:
       
   345 			__DEBUGGER();	/* Don't panic, do read on - you've hit this breakpoint because 
       
   346 							aMess has no helpful explananatory text for logging. Almost certainly 
       
   347 							this means an IPC function was added without updating this switch. Do
       
   348 							it now and make the world very slightly better! 
       
   349 							*/
       
   350 		}
       
   351 	return NULL; 	// unknown
       
   352 	}
       
   353 
       
   354 void ESockLog::IPCMessName(TSockMess aMessNum, TDes8& aMessBuf)
       
   355 	{
       
   356 	const TText8* mess = IPCMessName(aMessNum);
       
   357 	if (mess == NULL)
       
   358 		{
       
   359 		_LIT8(KUnknown, "IPC %d (UNKNOWN NAME - edit IPCMessName())");
       
   360 		aMessBuf.Format(KUnknown(), aMessNum);
       
   361 		}
       
   362 	else
       
   363 		{
       
   364 		aMessBuf.Copy(mess);
       
   365 		}
       
   366 	}
       
   367 
       
   368 
       
   369 const TText8* ESockLog::ConnServIPCMessName(TConnectionServerMessage aMess)
       
   370 /**
       
   371 Write a multiple argument list to the log, trapping and ignoring any leave
       
   372 */
       
   373 	{
       
   374 	switch(aMess)
       
   375 		{
       
   376 		case ECMCreate: return _S8("ECMCreate");
       
   377 		case ECMClose: return _S8("ECMClose");
       
   378 		case ECMAttachToTierManager: return _S8("ECMAttachToTierManager");
       
   379 		case ECMAccessPointStatusQuery_DoThenGetResultOrSize: return _S8("ECMAccessPointStatusQuery_DoThenGetResultOrSize");
       
   380 		case ECMAccessPointStatusQuery_GetResult: return _S8("ECMAccessPointStatusQuery_GetResult");
       
   381 		case ECMAccessPointStatusQuery_Cancel: return _S8("ECMAccessPointStatusQuery_Cancel");
       
   382 		case ECMAccessPointNotification_SetupThenAwaitThenGetResultOrSize: return _S8("ECMAccessPointNotification_SetupThenAwaitThenGetResultOrSize");
       
   383 		case ECMAccessPointNotification_AwaitThenGetResultOrSize: return _S8("ECMAccessPointNotification_AwaitThenGetResultOrSize");
       
   384 		case ECMAccessPointNotification_GetResult: return _S8("ECMAccessPointNotification_GetResult");
       
   385 		case ECMAccessPointNotification_Cancel: return _S8("ECMAccessPointNotification_Cancel");
       
   386 		case ECMApiExtBindIface: return _S8("ECommsApiExtBindIface");
       
   387 		case ECMApiExtIfaceSendReceive: return _S8("ECommsApiExtIfaceSendReceive");
       
   388 		case ECMApiExtIfaceSend: return _S8("ECommsApiExtIfaceSend");
       
   389 		case ECMApiExtIfaceClose: return _S8("ECommsApiExtIfaceClose");
       
   390 		default:
       
   391 			__DEBUGGER();	/* Don't panic, do read on - you've hit this breakpoint because 
       
   392 							aMess has no helpful explananatory text for logging. Almost certainly 
       
   393 							this means an IPC function was added without updating this switch. Do
       
   394 							it now and make the world very slightly better! 
       
   395 							*/
       
   396 		}
       
   397 	return NULL; 	// unknown
       
   398 	}
       
   399 
       
   400 void ESockLog::ConnServIPCMessName(TConnectionServerMessage aMessNum, TDes8& aMessBuf)
       
   401 	{
       
   402 	const TText8* mess = ConnServIPCMessName(aMessNum);
       
   403 	if (mess == NULL)
       
   404 		{
       
   405 		_LIT8(KUnknown, "IPC %d (UNKNOWN NAME - edit ConnServIPCMessName())");
       
   406 		aMessBuf.Format(KUnknown(), aMessNum);
       
   407 		}
       
   408 	else
       
   409 		{
       
   410 		aMessBuf.Copy(mess);
       
   411 		}
       
   412 	}
       
   413 
       
   414     
       
   415 #else // defined(__FLOG_ACTIVE) || defined (SYMBIAN_TRACE_ENABLE)
       
   416 
       
   417 EXPORT_C void ESockLogExternal::Printf(const TDesC8& /*aMajorTag*/, const TDesC8& /*aSubTag*/, TRefByValue<const TDesC8> /*aFmt*/, ...)
       
   418 	{
       
   419 	}
       
   420 
       
   421 EXPORT_C void ESockLogExternal::Printf(const TDesC8& /*aMajorTag*/, const TDesC8& /*aSubTag*/, TRefByValue<const TDesC8> /*aFmt*/, VA_LIST& /*aList*/)
       
   422 	{
       
   423 	}
       
   424 #endif
       
   425 
       
   426 
       
   427 EXPORT_C TInt ESockLogExternal::WorkerId()
       
   428     {
       
   429     CSockManData* globs = SockManGlobals::Get();
       
   430 	if (globs)
       
   431 		{
       
   432 		CWorkerThread* worker = globs->SelfWorker();
       
   433 		if (worker)
       
   434 		    {
       
   435 		    return (TInt)worker->WorkerId();
       
   436 			}
       
   437 		}
       
   438     return KErrNotFound;
       
   439     }
       
   440