eventsui/eventsutils/inc/evtdebug.h
branchRCL_3
changeset 17 1fc85118c3ae
parent 16 8173571d354e
child 18 870918037e16
equal deleted inserted replaced
16:8173571d354e 17:1fc85118c3ae
     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:  Debug File.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef _EVTDEBUG_H_
       
    20 #define _EVTDEBUG_H_
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32std.h>
       
    24 #include "evtdebugconfig.hrh"
       
    25 
       
    26 // MACROS
       
    27 #define DEBUG(TEXT) 				 { \
       
    28 									  _LIT( KText, #TEXT ); \
       
    29 									   Debug(KText); \
       
    30 									 }
       
    31 									 
       
    32 #define EVTUI(TEXT, ARG1) 			 { \
       
    33 									   _LIT( KText, #TEXT ); \
       
    34 									   Debug( KText, (ARG1) ); \
       
    35 									 }
       
    36 									 
       
    37 #define EVTUI2(TEXT, ARG1, ARG2) 		 { \
       
    38 									   _LIT( KText, #TEXT ); \
       
    39 									   Debug( KText,(ARG1), (ARG2) ); \
       
    40 									 }
       
    41 									 
       
    42 #define EVTUI3(TEXT, ARG1, ARG2, ARG3) { \
       
    43 									   _LIT( KText, #TEXT ); \
       
    44 									   Debug( KText, (ARG1), (ARG2), (ARG3) ); \
       
    45 									 }
       
    46 
       
    47 IMPORT_C void CreateDir();
       
    48 
       
    49 IMPORT_C void Debug( TRefByValue<const TDesC> aText, ...);
       
    50 
       
    51 /**
       
    52 * By using component specific debug macros unnecessary 
       
    53 * debug prints can be avoided. 
       
    54 * Also component specific debugging is possible by compiling 
       
    55 * only certain components when EVTUI_ENABLE_DEBUG_PRINT is defined.
       
    56 */
       
    57 
       
    58 #ifdef EVTUI_ENABLE_DEBUG_PRINT
       
    59 
       
    60 #define CREATELOGDIR()						 { CreateDir();};									 
       
    61 #define EVTUIDEBUG(TEXT)                     DEBUG(TEXT);
       
    62 #define EVTUIDEBUG1(TEXT, ARG1)              EVTUI(TEXT, ARG1);
       
    63 #define EVTUIDEBUG2(TEXT, ARG1, ARG2)        EVTUI2(TEXT, ARG1, ARG2);
       
    64 #define EVTUIDEBUG3(TEXT, ARG1, ARG2, ARG3)  EVTUI3(TEXT, ARG1, ARG2, ARG3);
       
    65 
       
    66 #else
       
    67 
       
    68 #define CREATELOGDIR()						 ;
       
    69 #define EVTUIDEBUG(TEXT)                     ;
       
    70 #define EVTUIDEBUG1(TEXT, ARG1)              ;
       
    71 #define EVTUIDEBUG2(TEXT, ARG1, ARG2)        ;
       
    72 #define EVTUIDEBUG3(TEXT, ARG1, ARG2, ARG3)  ;
       
    73 
       
    74 #endif
       
    75 
       
    76 #endif // _EVTDEBUG_H_