telephonyprotocols/pdplayer/umts/spudtel/inc/spudteldebuglogger.h
branchRCL_3
changeset 65 630d2f34d719
parent 61 17af172ffa5f
child 66 07a122eea281
equal deleted inserted replaced
61:17af172ffa5f 65:630d2f34d719
     1 // Copyright (c) 2004-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 // Event Logger header
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalComponent
       
    21 */
       
    22 
       
    23 #ifndef SPUDTELDEBUGLOGGER_H
       
    24 #define SPUDTELDEBUGLOGGER_H
       
    25 
       
    26 
       
    27 #include "comms-infras/commsdebugutility.h"
       
    28 
       
    29 #ifdef __FLOG_ACTIVE
       
    30 
       
    31 #include <e32base.h>
       
    32 #include <e32def.h>
       
    33 
       
    34 
       
    35 _LIT8(KSpudTelLogFile,"SPUDTEL.TXT");
       
    36 _LIT8(KSpudTelLogFileVerbose,"SPUDTELVERB.TXT");
       
    37 _LIT8(KSpudTelLogFolder,"SPUD");
       
    38 
       
    39 // pure informational logging
       
    40 #if defined(_INFO_LOG)
       
    41 // Static info Output Logging Macros
       
    42 #define SPUDTEL_INFO_LOG(text) 					__FLOG_STATIC0(KSpudTelLogFolder,KSpudTelLogFile,text)
       
    43 #define SPUDTEL_INFO_LOG1(text,a)				__FLOG_STATIC1(KSpudTelLogFolder,KSpudTelLogFile,text, a)
       
    44 #define SPUDTEL_INFO_LOG2(text,a, b)			__FLOG_STATIC2(KSpudTelLogFolder,KSpudTelLogFile,text,a,b)
       
    45 #define SPUDTEL_INFO_LOG3(text,a, b, c)			__FLOG_STATIC3(KSpudTelLogFolder,KSpudTelLogFile,text,a,b,c)
       
    46 #define SPUDTELVERBOSE_INFO_LOG(text) 			__FLOG_STATIC0(KSpudTelLogFolder,KSpudTelLogFileVerbose,text)
       
    47 #define SPUDTELVERBOSE_INFO_LOG1(text,a)		__FLOG_STATIC1(KSpudTelLogFolder,KSpudTelLogFileVerbose,text, a)
       
    48 #define SPUDTELVERBOSE_INFO_LOG2(text,a, b)		__FLOG_STATIC2(KSpudTelLogFolder,KSpudTelLogFileVerbose,text,a,b)
       
    49 #define SPUDTELVERBOSE_INFO_LOG3(text,a, b, c)	__FLOG_STATIC3(KSpudTelLogFolder,KSpudTelLogFileVerbose,text,a,b,c)
       
    50 
       
    51 
       
    52 _LIT(KSpudTelMsgIn, ">>%S");
       
    53 _LIT(KSpudTelMsgOut,"<<%S");
       
    54 
       
    55 class TSpudTelLogFn
       
    56 {
       
    57 protected:
       
    58 	TName iName;
       
    59 
       
    60 public:
       
    61 	TSpudTelLogFn(const TDesC& aName) 	{ iName = aName; SPUDTELVERBOSE_INFO_LOG1(KSpudTelMsgIn, &iName);};
       
    62 	~TSpudTelLogFn()					{ SPUDTELVERBOSE_INFO_LOG1(KSpudTelMsgOut, &iName);};
       
    63 };
       
    64 
       
    65 #define SPUDTEL_FNLOG(name) TSpudTelLogFn spudTelLogFn(_L(name))
       
    66 
       
    67 #else // defined(_INFO_LOG)
       
    68 
       
    69 #define SPUDTEL_INFO_LOG(text)
       
    70 #define SPUDTEL_INFO_LOG1(text,a)
       
    71 #define SPUDTEL_INFO_LOG2(text,a, b)
       
    72 #define SPUDTEL_INFO_LOG3(text,a, b, c)
       
    73 #define SPUDTEL_FNLOG(name) 
       
    74 #define SPUDTELVERBOSE_INFO_LOG(text)
       
    75 #define SPUDTELVERBOSE_INFO_LOG1(text,a)
       
    76 #define SPUDTELVERBOSE_INFO_LOG2(text,a, b)
       
    77 #define SPUDTELVERBOSE_INFO_LOG3(text,a, b, c)
       
    78 
       
    79 #endif // defined(_INFO_LOG)
       
    80 
       
    81 
       
    82 // error logging
       
    83 #if defined(_ERROR_LOG)
       
    84 
       
    85 #define SPUDTEL_ERROR_LOG(errtext, err)	__FLOG_STATIC1(KSpudTelLogFolder,KSpudTelLogFile, errtext, err)
       
    86 #define SPUDTEL_ERROR_LOG0(errtext)		__FLOG_STATIC0(KSpudTelLogFolder,KSpudTelLogFile, errtext)
       
    87 
       
    88 #else // defined(_ERROR_LOG)
       
    89 
       
    90 #define SPUDTEL_ERROR_LOG(errtext, err)
       
    91 #define SPUDTEL_ERROR_LOG0(errtext)
       
    92 
       
    93 #endif // defined(_ERROR_LOG)
       
    94 
       
    95 
       
    96 #else	// __FLOG_ACTIVE
       
    97 
       
    98 #define SPUDTEL_INFO_LOG(t)
       
    99 #define SPUDTEL_INFO_LOG1(t,a)
       
   100 #define SPUDTEL_INFO_LOG2(t,a,b)
       
   101 #define SPUDTEL_INFO_LOG3(t,a,b,c)
       
   102 #define SPUDTEL_FNLOG(name)
       
   103 #define SPUDTELVERBOSE_INFO_LOG(t)
       
   104 #define SPUDTELVERBOSE_INFO_LOG1(t,a)
       
   105 #define SPUDTELVERBOSE_INFO_LOG2(t,a,b)
       
   106 #define SPUDTELVERBOSE_INFO_LOG3(t,a,b,c)
       
   107 #define SPUDTEL_ERROR_LOG(errtext, err)
       
   108 #define SPUDTEL_ERROR_LOG0(errtext)
       
   109 
       
   110 
       
   111 #endif //__FLOG_ACTIVE
       
   112 #endif
       
   113 // SPUDTELDEBUGLOGGER_H
       
   114