locationsystemui/locationsysui/locutils/inc/locutilsdebug.h
branchRCL_3
changeset 44 2b4ea9893b66
parent 42 02ba3f1733c6
child 45 6b6920c56e2f
equal deleted inserted replaced
42:02ba3f1733c6 44:2b4ea9893b66
     1 /*
       
     2 * Copyright (c) 2002 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:  LocUtilsDebug contains debug macros.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef _LOCUTILSDEBUG_H_
       
    20 #define _LOCUTILSDEBUG_H_
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32std.h>
       
    24 #include "locutilsdebugconfig.hrh"
       
    25 
       
    26 // MACROS
       
    27 #define DEBUG(TEXT) 				 { \
       
    28 									  _LIT( KText, #TEXT ); \
       
    29 									   Debug(KText) \
       
    30 									 }
       
    31 									 
       
    32 #define LOC(TEXT, ARG1) 			 { \
       
    33 									   _LIT( KText, #TEXT ); \
       
    34 									   Debug( KText, (ARG1) ); \
       
    35 									 }
       
    36 									 
       
    37 #define LOC2(TEXT, ARG1, ARG2) 		 { \
       
    38 									   _LIT( KText, #TEXT ); \
       
    39 									   Debug( KText,(ARG1), (ARG2) ); \
       
    40 									 }
       
    41 									 
       
    42 #define LOC3(TEXT, ARG1, ARG2, ARG3) { \
       
    43 									   _LIT( KText, #TEXT ); \
       
    44 									   Debug( KText, (ARG1), (ARG2), (ARG3) ); \
       
    45 									 }
       
    46 
       
    47 IMPORT_C void Debug( TRefByValue<const TDesC> aText, ...);
       
    48 
       
    49 /**
       
    50 * By using component specific debug macros unnecessary 
       
    51 * debug prints can be avoided. 
       
    52 * Also component specific debugging is possible by compiling 
       
    53 * only certain components when LOC_ENABLE_DEBUG_PRINT is defined.
       
    54 */
       
    55 
       
    56 #ifdef LOC_ENABLE_DEBUG_PRINT
       
    57 
       
    58 #define LOCUTILSDEBUG(TEXT)                     DEBUG(TEXT);
       
    59 #define LOCUTILSDEBUG1(TEXT, ARG1)              LOC(TEXT, ARG1);
       
    60 #define LOCUTILSDEBUG2(TEXT, ARG1, ARG2)        LOC2(TEXT, ARG1, ARG2);
       
    61 #define LOCUTILSDEBUG3(TEXT, ARG1, ARG2, ARG3)  LOC3(TEXT, ARG1, ARG2, ARG3);
       
    62 
       
    63 #else
       
    64 
       
    65 #define LOCUTILSDEBUG(TEXT)                     ;
       
    66 #define LOCUTILSDEBUG1(TEXT, ARG1)              ;
       
    67 #define LOCUTILSDEBUG2(TEXT, ARG1, ARG2)        ;
       
    68 #define LOCUTILSDEBUG3(TEXT, ARG1, ARG2, ARG3)  ;
       
    69 
       
    70 #endif
       
    71 
       
    72 #endif // _LOCUTILSDEBUG_H_