os/kernelhwsrv/kernel/eka/debug/securityServer/inc/rm_debug_logging.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2006-2009 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 RM_DEBUG_LOGGING_H
    19 #define RM_DEBUG_LOGGING_H
    20 
    21 /* Debug messages
    22  * 
    23  * Debug messages are only generated for debug builds.
    24  * 
    25  * For kernel mode, use __KTRACE_OPT(KDEBUGGER, Kern::Printf(), 
    26  * for user mode use RDebug::Printf(). 
    27  * 
    28  */
    29 
    30 #ifdef _DEBUG
    31 
    32   #ifdef __KERNEL_MODE__
    33 
    34     #include <kernel/kernel.h>
    35     #include <nkern/nk_trace.h>
    36 
    37     #define LOG_MSG( a )            __KTRACE_OPT(KDEBUGGER, Kern::Printf( a ))
    38     #define LOG_MSG2( a, b )        __KTRACE_OPT(KDEBUGGER, Kern::Printf( a, b ))
    39     #define LOG_MSG3( a, b, c )     __KTRACE_OPT(KDEBUGGER, Kern::Printf( a, b, c ))
    40     #define LOG_MSG4( a, b, c, d )  __KTRACE_OPT(KDEBUGGER, Kern::Printf( a, b, c, d ))
    41     #define LOG_MSG5( a, b, c, d, e )  __KTRACE_OPT(KDEBUGGER, Kern::Printf( a, b, c, d, e ))
    42   #else
    43 
    44     #include <e32debug.h>
    45 
    46     #define LOG_MSG( a )              RDebug::Printf( a )
    47     #define LOG_MSG2( a, b )          RDebug::Printf( a, b )
    48     #define LOG_MSG3( a, b, c )       RDebug::Printf( a, b, c )
    49     #define LOG_MSG4( a, b, c, d )    RDebug::Printf( a, b, c, d )
    50     #define LOG_MSG5( a, b, c, d, e )    RDebug::Printf( a, b, c, d, e )
    51 
    52   #endif
    53 
    54 #else
    55 
    56   #define LOG_MSG( a )
    57   #define LOG_MSG2( a, b )
    58   #define LOG_MSG3( a, b, c )
    59   #define LOG_MSG4( a, b, c, d )
    60   #define LOG_MSG5( a, b, c, d, e )
    61 
    62 #endif
    63 
    64 #endif //RM_DEBUG_LOGGING_H
    65