debugsrv/runmodedebug/rmdebug_test/rm_debug/common/t_debug_logging.h
changeset 56 aa2539c91954
parent 54 a151135b0cf9
child 60 e54443a6878c
child 62 1c2bb2fc7c87
equal deleted inserted replaced
54:a151135b0cf9 56:aa2539c91954
     1 // Copyright (c) 2006-2010 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 the License "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 // Logging macros for use in debug subsystem
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef RMDEBUG_LOGGING_H
       
    19 #define RMDEBUG_LOGGING_H
       
    20 
       
    21 /* Debug messages
       
    22  * 
       
    23  * Debug messages are only generated for debug builds.
       
    24  * 
       
    25  * As user mode use RDebug::Printf(). 
       
    26  * 
       
    27  */
       
    28 
       
    29 // Uncomment if logging of required
       
    30 //#define RMDEBUG_LOGGING 
       
    31 
       
    32 #ifdef RMDEBUG_LOGGING
       
    33 
       
    34    #include <e32debug.h>
       
    35 
       
    36     #define LOG_MSG(args...)            RDebug::Printf(args)
       
    37     #define LOG_DES(args...)            RDebug::Print(args) // For wide descriptors
       
    38     #define LOG_ENTRY()                 RDebug::Printf("+%s", __PRETTY_FUNCTION__)
       
    39     #define LOG_EXIT()                  RDebug::Printf("-%s", __PRETTY_FUNCTION__)
       
    40     #define LOG_ARGS(fmt, args...)      RDebug::Printf("+%s " fmt, __PRETTY_FUNCTION__, args)
       
    41     #define LOG_RETURN(x)               RDebug::Printf("Returning %d from [%s]", x, __PRETTY_FUNCTION__)
       
    42 
       
    43     // Kept for compatibility
       
    44     #define LOG_MSG2( a, b )            RDebug::Printf( a, b )
       
    45     #define LOG_MSG3( a, b, c )         RDebug::Printf( a, b, c )
       
    46     #define LOG_MSG4( a, b, c, d )      RDebug::Printf( a, b, c, d )
       
    47     #define LOG_MSG5( a, b, c, d, e )   RDebug::Printf( a, b, c, d, e )
       
    48 
       
    49 #else
       
    50 
       
    51    #include <e32debug.h>
       
    52 
       
    53     #define LOG_MSG(args...)            
       
    54     #define LOG_DES(args...)           
       
    55     #define LOG_ENTRY()                 
       
    56     #define LOG_EXIT()                 
       
    57     #define LOG_ARGS(fmt, args...)      
       
    58     #define LOG_RETURN(x)               
       
    59 
       
    60     // Kept for compatibility
       
    61     #define LOG_MSG2( a, b )            
       
    62     #define LOG_MSG3( a, b, c )         
       
    63     #define LOG_MSG4( a, b, c, d )     
       
    64     #define LOG_MSG5( a, b, c, d, e )  
       
    65 
       
    66 #endif 
       
    67 
       
    68 #endif //RMDEBUG_LOGGING