presadap12/Parser2/Inc/PresenceDebugPrint.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Presence Engine logging tools.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __PENGDEBUGPRINT_H__
       
    19 #define __PENGDEBUGPRINT_H__
       
    20 
       
    21 //  INCLUDES
       
    22 #include    "PEngConfig.h"
       
    23 
       
    24 
       
    25 // -----------------------------------------------------------------------------
       
    26 // Debug logging is enabled
       
    27 // -----------------------------------------------------------------------------
       
    28 #ifdef PENG_ENABLE_DEBUG_PRINT
       
    29 
       
    30 // INCLUDES
       
    31 #include    "PEngLogger.h"
       
    32 
       
    33 // CONSTANTS
       
    34 _LIT( KPENGDebugOutputDir, "PENG" );
       
    35 _LIT( KPENGDebugOutputFileName, "PEng2.log" );
       
    36 const TInt KPEngMaxLogLineLength = 250;
       
    37 
       
    38 
       
    39 // TARGET WARNING
       
    40 #ifndef _DEBUG
       
    41 #if defined(__VC32__)
       
    42 #pragma message( "Warning: Presence Engine debug printing _ON_" )	// CSI: 68 #
       
    43 #else // __GCC32__
       
    44 #warning "Presence Engine debug printing _ON_"
       
    45 #endif // __VC32__
       
    46 #endif
       
    47 
       
    48 
       
    49 // DEBUG PRINT INDIRECTION
       
    50 #define D_PENG_LIT(s) _L(s)		// CSI: 78 #
       
    51 #define PENG_DP PEngLogger::WriteLog
       
    52 #define PENG_DP_TXT( s ) PEngLogger::WriteLog( D_PENG_LIT( s ) )
       
    53 
       
    54 // DEBUG PRINTING IF FOR STATEMENTS
       
    55 #define PENG_IF_DP( statement ) statement
       
    56 
       
    57 
       
    58 // TOKEN PASTING HELPERS FOR DEBUG PRINTING
       
    59 #define PENG_STRINGIZE(l) L#l
       
    60 #define PENG_TOKEN_PASTING(s) L##s
       
    61 
       
    62 
       
    63 
       
    64 
       
    65 //-----------------------------------------------------------------------------
       
    66 // Empty implementations for non-debug printing builds.
       
    67 //-----------------------------------------------------------------------------
       
    68 #else
       
    69 // EMPTY DEBUG PRINTING IF
       
    70 #define PENG_IF_DP( statement )
       
    71 
       
    72 // DUMMY PARAMETER STRUCT
       
    73 struct TPEngEmptyDebugString { };
       
    74 
       
    75 
       
    76 // DEBUG PRINT INDIRECTION
       
    77 #define D_PENG_LIT(s) TPEngEmptyDebugString()
       
    78 #define PENG_DP_TXT(s) PENG_DP( D_PENG_LIT(s) )
       
    79 
       
    80 
       
    81 // EMPTY DEBUG PRINT FUNCTIONS
       
    82 inline void PENG_DP( TPEngEmptyDebugString )
       
    83     {
       
    84     }
       
    85 
       
    86 template<class T1>
       
    87 inline void PENG_DP( TPEngEmptyDebugString, T1 )
       
    88     {
       
    89     }
       
    90 
       
    91 template<class T1, class T2>
       
    92 inline void PENG_DP( TPEngEmptyDebugString, T1, T2 )
       
    93     {
       
    94     }
       
    95 
       
    96 template<class T1, class T2, class T3>
       
    97 inline void PENG_DP( TPEngEmptyDebugString, T1, T2, T3 )
       
    98     {
       
    99     }
       
   100 
       
   101 template<class T1, class T2, class T3, class T4>
       
   102 inline void PENG_DP( TPEngEmptyDebugString, T1, T2, T3, T4 )
       
   103     {
       
   104     }
       
   105 
       
   106 template<class T1, class T2, class T3, class T4, class T5>
       
   107 inline void PENG_DP( TPEngEmptyDebugString, T1, T2, T3, T4, T5 )
       
   108     {
       
   109     }
       
   110 
       
   111 template<class T1, class T2, class T3, class T4, class T5, class T6>
       
   112 inline void PENG_DP( TPEngEmptyDebugString, T1, T2, T3, T4, T5, T6 )
       
   113     {
       
   114     }
       
   115 
       
   116 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7>
       
   117 inline void PENG_DP( TPEngEmptyDebugString, T1, T2, T3, T4, T5, T6, T7 )
       
   118     {
       
   119     }
       
   120 
       
   121 template<class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8>
       
   122 inline void PENG_DP( TPEngEmptyDebugString, T1, T2, T3, T4, T5, T6, T7, T8 )
       
   123     {
       
   124     }
       
   125 
       
   126 #endif  // PENG_ENABLE_DEBUG_PRINT
       
   127 
       
   128 
       
   129 #endif  // __PENGDEBUGPRINT_H__
       
   130 
       
   131 //  End of File