datacommsserver/esockserver/inc/ss_log.h
changeset 0 dfb7c4ff071f
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 /**
       
    17  @file
       
    18  @internalComponent
       
    19 */
       
    20 
       
    21 
       
    22 #ifndef __SS_LOG_H__
       
    23 #define __SS_LOG_H__
       
    24 
       
    25 #include <cflog.h>
       
    26 #include <comms-infras/cfmacro.h>
       
    27 #include <comms-infras/ss_logext.h>
       
    28 #include <comms-infras/sockmes.h>
       
    29 #include <comms-infras/es_connectionservermessages.h>
       
    30 
       
    31 
       
    32 
       
    33 // Minor levels of log tagging
       
    34 _LIT8(KESockClientTag, "Client");			// the common client-side case
       
    35 _LIT8(KESockServerTag, "Server");			// the common server-side case
       
    36 _LIT8(KESockBootingTag, "Booting");			// grim & verbose details of booting & shutting down
       
    37 _LIT8(KESockProvChoresTag, "ProvChores");	// housekeeping activities for providers & protocols (eg [re]loading PRT)
       
    38 _LIT8(KESockSessDetailTag, "Detail");		// detailed session handling & MT logs
       
    39 _LIT8(KESockCoreProviderTag, "CoreProv");
       
    40 _LIT8(KESockLockTag, "Lock");
       
    41 _LIT8(KESockErrorTag, "Error");			// exceptional circumstances (like panic'ing a client).
       
    42 _LIT8(KFactoryTag, "Factory");          // log for Comms factory components
       
    43 
       
    44 #if defined (__CFLOG_ACTIVE) || defined (SYMBIAN_TRACE_ENABLE)
       
    45 
       
    46 
       
    47 /**
       
    48 @internalComponent
       
    49 */
       
    50 const TInt KHexDumpWidth = 16;
       
    51 
       
    52 /**
       
    53 @internalComponent
       
    54 */
       
    55 #ifndef LOG
       
    56 	#define ESOCK_LOGGING_ACTIVE
       
    57 	#define LOG(x) x
       
    58 	#if defined(DETAILED_LOG)
       
    59 		#define LOG_DETAILED(a) a
       
    60 	#else
       
    61 		#define LOG_DETAILED(a)
       
    62 	#endif
       
    63 #endif
       
    64 
       
    65 #ifndef LOG_STMT
       
    66 	#define LOG_STMT(a) a
       
    67 #endif
       
    68 
       
    69 class ESockLog : public ESockLogExternal
       
    70 /**
       
    71 @internalComponent
       
    72 */
       
    73 	{
       
    74 public:
       
    75 	static void Printf(TRefByValue<const TDesC> aFmt, ...);
       
    76 	static void Printf(const TDesC8& aSubTag, TRefByValue<const TDesC> aFmt, ...);
       
    77 	static void Printf(const TDesC8& aSubTag, TRefByValue<const TDesC> aFmt, VA_LIST& aList);
       
    78 	static void Printf(const TDesC8& aMajorTag, const TDesC8& aSubTag, TRefByValue<const TDesC> aFmt, VA_LIST& aList);
       
    79 	static void Printf(TRefByValue<const TDesC8> aFmt, ...);
       
    80 	static void Printf(const TDesC8& aSubTag, TRefByValue<const TDesC8> aFmt, ...);
       
    81 	static void Printf(const TDesC8& aSubTag, TRefByValue<const TDesC8> aFmt, VA_LIST& aList);
       
    82 	static void ConnectionInfoPrintf(const TDesC8& aConnectionInfo, TRefByValue<const TDesC> aFmt, ...);
       
    83 	static const TText8* IPCMessName(TSockMess aMess);
       
    84 	static void IPCMessName(TSockMess aMessNum, TDes8& aMessBuf);
       
    85 	static const TText8* ConnServIPCMessName(TConnectionServerMessage aMess);
       
    86 	static void ConnServIPCMessName(TConnectionServerMessage aMessNum, TDes8& aMessBuf);
       
    87 	};
       
    88 
       
    89 class TLogIgnoreOverflow8 : public TDes8Overflow
       
    90 	{
       
    91 public:
       
    92 	void Overflow(TDes8& /*aDes*/) { }
       
    93 	};
       
    94 
       
    95 class TLogIgnoreOverflow16 : public TDes16Overflow
       
    96 	{
       
    97 public:
       
    98 	void Overflow(TDes16& /*aDes*/) { }
       
    99 	};
       
   100 
       
   101 #else
       
   102 #define LOG(x)
       
   103 #define LOG_DETAILED(a)
       
   104 #define LOG_STMT(a)
       
   105 #endif
       
   106 
       
   107 
       
   108 
       
   109 #endif
       
   110 // __SS_LOG_H__
       
   111