sysstatemgmt/syslangutil/inc/syslangutiltrace.h
changeset 0 4e1aa6a622a0
child 52 d6b9e89d80a3
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     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:  Tracing macros for SysLangUtil module.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __SYSLANGUTILTRACE_H_
       
    20 #define __SYSLANGUTILTRACE_H_
       
    21 
       
    22 #ifdef _DEBUG
       
    23     #include <e32cmn.h>
       
    24 
       
    25     void AssertTraceFunc( const TDesC8& aFile, TInt aLine );
       
    26     void TraceFunc( TRefByValue<const TDesC16> aFmt, ... );
       
    27 
       
    28     #define ASSERT_ALWAYS_TRACE     AssertTraceFunc( _L8( __FILE__ ), __LINE__ )
       
    29     #define ASSERT_TRACE( a )       if( !( a ) ) { ASSERT_ALWAYS_TRACE; }
       
    30     #define ERROR_TRACE_1( a, b )   TraceFunc( _L( a ), b )
       
    31 #else
       
    32     #define ASSERT_ALWAYS_TRACE
       
    33     #define ASSERT_TRACE( a )
       
    34     #define ERROR_TRACE_1( a, b )
       
    35 #endif
       
    36 
       
    37 #if defined _DEBUG && defined __SYSLANG_TRACE__
       
    38     void FuncEntryTrace( const TDesC8& aFunction, TBool aPrintCaller );
       
    39     void FuncExitTrace( const TDesC8& aFunction );
       
    40     void FuncExitTrace( const TDesC8& aFunction, const TInt aReturnValue );
       
    41 
       
    42     #define FUNC_NAME _L8( __PRETTY_FUNCTION__ )
       
    43 
       
    44     #define FUNC_ENTRY_TRACE            FuncEntryTrace( FUNC_NAME, EFalse )
       
    45     #define API_FUNC_ENTRY_TRACE        FuncEntryTrace( FUNC_NAME, ETrue )
       
    46     #define FUNC_EXIT_TRACE             FuncExitTrace( FUNC_NAME )
       
    47     #define FUNC_EXIT_RET_TRACE( a )    FuncExitTrace( FUNC_NAME, a )
       
    48 #else
       
    49     #define FUNC_ENTRY_TRACE
       
    50     #define API_FUNC_ENTRY_TRACE
       
    51     #define FUNC_EXIT_TRACE
       
    52     #define FUNC_EXIT_RET_TRACE( a )
       
    53 #endif
       
    54 
       
    55 #endif // __SYSLANGUTILTRACE_H_