os/kernelhwsrv/kernel/eka/debug/securityServer/inc/rm_debug_logging.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kernel/eka/debug/securityServer/inc/rm_debug_logging.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,65 @@
     1.4 +// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// Logging macros for use in debug subsystem
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +#ifndef RM_DEBUG_LOGGING_H
    1.22 +#define RM_DEBUG_LOGGING_H
    1.23 +
    1.24 +/* Debug messages
    1.25 + * 
    1.26 + * Debug messages are only generated for debug builds.
    1.27 + * 
    1.28 + * For kernel mode, use __KTRACE_OPT(KDEBUGGER, Kern::Printf(), 
    1.29 + * for user mode use RDebug::Printf(). 
    1.30 + * 
    1.31 + */
    1.32 +
    1.33 +#ifdef _DEBUG
    1.34 +
    1.35 +  #ifdef __KERNEL_MODE__
    1.36 +
    1.37 +    #include <kernel/kernel.h>
    1.38 +    #include <nkern/nk_trace.h>
    1.39 +
    1.40 +    #define LOG_MSG( a )            __KTRACE_OPT(KDEBUGGER, Kern::Printf( a ))
    1.41 +    #define LOG_MSG2( a, b )        __KTRACE_OPT(KDEBUGGER, Kern::Printf( a, b ))
    1.42 +    #define LOG_MSG3( a, b, c )     __KTRACE_OPT(KDEBUGGER, Kern::Printf( a, b, c ))
    1.43 +    #define LOG_MSG4( a, b, c, d )  __KTRACE_OPT(KDEBUGGER, Kern::Printf( a, b, c, d ))
    1.44 +    #define LOG_MSG5( a, b, c, d, e )  __KTRACE_OPT(KDEBUGGER, Kern::Printf( a, b, c, d, e ))
    1.45 +  #else
    1.46 +
    1.47 +    #include <e32debug.h>
    1.48 +
    1.49 +    #define LOG_MSG( a )              RDebug::Printf( a )
    1.50 +    #define LOG_MSG2( a, b )          RDebug::Printf( a, b )
    1.51 +    #define LOG_MSG3( a, b, c )       RDebug::Printf( a, b, c )
    1.52 +    #define LOG_MSG4( a, b, c, d )    RDebug::Printf( a, b, c, d )
    1.53 +    #define LOG_MSG5( a, b, c, d, e )    RDebug::Printf( a, b, c, d, e )
    1.54 +
    1.55 +  #endif
    1.56 +
    1.57 +#else
    1.58 +
    1.59 +  #define LOG_MSG( a )
    1.60 +  #define LOG_MSG2( a, b )
    1.61 +  #define LOG_MSG3( a, b, c )
    1.62 +  #define LOG_MSG4( a, b, c, d )
    1.63 +  #define LOG_MSG5( a, b, c, d, e )
    1.64 +
    1.65 +#endif
    1.66 +
    1.67 +#endif //RM_DEBUG_LOGGING_H
    1.68 +