stif/TestCombiner/inc/Logging.h
branchRCL_3
changeset 59 8ad140f3dd41
parent 0 a03f92240627
equal deleted inserted replaced
49:7fdc9a71d314 59:8ad140f3dd41
       
     1 /*
       
     2 * Copyright (c) 2009 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: This file contains Logging macros for test combiner
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef LOGGINGDEFS_H
       
    19 #define LOGGINGDEFS_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <e32std.h>
       
    23 #include <e32base.h>
       
    24 
       
    25 
       
    26 // CONSTANTS
       
    27 const TUint KError              = 0x1;
       
    28 const TUint KInit               = 0x2;
       
    29 const TUint KPrint              = 0x4;
       
    30 const TUint KMessage            = 0x10;
       
    31 const TUint KFunction           = 0x20;
       
    32 const TUint KVerbose            = 0x40;
       
    33 const TUint KAlways             = 0xFFFFFFFF;
       
    34 const TUint KDebugLevel         = ( KPrint | KError | KMessage );
       
    35 
       
    36 // MACROS
       
    37 #define __TRACING_ENABLED
       
    38 
       
    39 #ifdef __TRACING_ENABLED
       
    40 
       
    41      // Disable conditional expression is constant -warning
       
    42     #pragma warning( disable : 4127 )
       
    43 
       
    44     // General tracing function
       
    45     #define __TRACE(level,p) if ( ( (level) & KDebugLevel ) && LOGGER )\
       
    46                                           {LOGGER->Log p;}
       
    47               
       
    48     // Direct RDebug::Print                            
       
    49     #define __RDEBUG(p) if( KVerbose & KDebugLevel ){ RDebug::Print p ; } 
       
    50 
       
    51 
       
    52      // Log function name
       
    53     #define __TRACEFUNC() if( ( KFunction & KDebugLevel ) && LOGGER ){\
       
    54                                 const char* f = __FUNCTION__;\
       
    55                                  TPtrC8 F((const unsigned char*)f);\
       
    56                                  LOGGER->Log(F);}
       
    57 
       
    58 #else // __TRACING_ENABLED
       
    59      // No tracing
       
    60     #define __TRACE(level,p)
       
    61     #define __RDEBUG(p)
       
    62     #define __TRACEFUNC()
       
    63 #endif // __TRACING_ENABLED
       
    64 
       
    65 
       
    66 // DATA TYPES
       
    67 
       
    68 // FUNCTION PROTOTYPES
       
    69 
       
    70 // FORWARD DECLARATIONS
       
    71 
       
    72 // CLASS DECLARATION
       
    73 
       
    74 #endif // LOGGINGDEFS_H
       
    75 
       
    76 // End of File