phoneuis/BubbleManager/Inc/BMBubbleDebug.h
changeset 0 5f000ab63145
child 25 91c2fb4b78df
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     1 /*
       
     2 * Copyright (c) 2002-2005 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:  Macro definitions for tracing and debugging purposes.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef BM_DEBUG_H
       
    20 #define BM_DEBUG_H
       
    21 
       
    22 //#ifdef _DEBUG 
       
    23 
       
    24 // INCLUDES
       
    25 #include <e32svr.h>
       
    26 
       
    27 // CONSTANTS
       
    28 _LIT( KComponent, "[BUBBLEMANAGER]" );
       
    29 _LIT( KThisFile,  "[BUBBLEMANAGER] - Trace this file: %s, line: %d, compiled: %s %s" );
       
    30 _LIT( KAssertion, "[BUBBLEMANAGER] - Assertion failed: File: %s, line: %d, compiled: %s %s" );
       
    31 _LIT( KPanic,     "[BUBBLEMANAGER] - Panic occurred: File: %s, line: %d, compiled: %s %s" );
       
    32 _LIT( KMystic,    "[BUBBLEMANAGER] - Mystic failure: File: %s, line: %d, compiled: %s %s" );
       
    33 _LIT8( KDATE, __DATE__ );
       
    34 _LIT8( KTIME, __TIME__ );
       
    35 
       
    36 const TInt KTraceMaxSize = 256;
       
    37 
       
    38 // DATA TYPES
       
    39 enum TTraceType
       
    40     {
       
    41     ETraceInit,
       
    42     ETraceAssert,
       
    43     ETracePanic
       
    44     };
       
    45 
       
    46 // INLINE FUNCTIONS
       
    47  
       
    48  
       
    49 
       
    50     #define BM_TRACE_( AAA ) do\
       
    51         { _LIT( logStr, AAA ); RDebug::Print( logStr ); } while ( 0 )
       
    52     
       
    53     #define BM_TRACE_1( AAA, BBB ) do\
       
    54          { _LIT( logStr, AAA ); RDebug::Print( logStr, BBB ); } while ( 0 )
       
    55     
       
    56     #define BM_TRACE_2( AAA, BBB, CCC ) do\
       
    57          { _LIT( logStr, AAA ); RDebug::Print( logStr, BBB, CCC ); } while ( 0 )
       
    58     
       
    59     #define BM_TRACE_3( AAA, BBB, CCC, DDD ) do\
       
    60          { _LIT( logStr, AAA ); RDebug::Print( logStr, BBB, CCC, DDD ); } while ( 0 )
       
    61     
       
    62     #define BM_TRACE_4( AAA, BBB, CCC, DDD, EEE ) do\
       
    63          { _LIT( logStr, AAA ); RDebug::Print( logStr, BBB, CCC, DDD, EEE ); } while ( 0 )
       
    64     
       
    65     #define BM_TRACE_RAW_( AAA ) do\
       
    66         { RDebug::RawPrint( AAA ); } while ( 0 )
       
    67         
       
    68     #define BM_TRACE_RAW_1( AAA, BBB ) do\
       
    69          { _LIT( logStr, AAA ); TBuf<KTraceMaxSize> buffer; buffer.Append( logStr ); buffer.Append( BBB );\
       
    70          RDebug::RawPrint( buffer ); } while ( 0 )
       
    71        
       
    72 
       
    73     
       
    74 
       
    75     
       
    76 /*
       
    77 #else // _DEBUG
       
    78 
       
    79     #define TRACE_ASSERT( a )
       
    80     #define TRACE_ASSERT_RETURN( a ) a
       
    81     #define TRACE_ASSERT_ALWAYS
       
    82 
       
    83     #define BM_TRACE_( AAA )
       
    84     #define BM_TRACE_1( AAA, BBB )
       
    85     #define BM_TRACE_2( AAA, BBB, CCC )
       
    86     #define BM_TRACE_3( AAA, BBB, CCC, DDD )
       
    87     #define BM_TRACE_4( AAA, BBB, CCC, DDD, EEE )
       
    88     #define BM_TRACE_RAW_( AAA )
       
    89     #define BM_TRACE_RAW_1( AAA, BBB )
       
    90 
       
    91     #define API_TRACE_( AAA )
       
    92     #define API_TRACE_1( AAA, BBB )
       
    93     #define API_TRACE_2( AAA, BBB, CCC )
       
    94     #define API_TRACE_3( AAA, BBB, CCC, DDD )
       
    95     #define API_TRACE_4( AAA, BBB, CCC, DDD, EEE )
       
    96     #define API_TRACE_RAW_1( AAA, BBB )
       
    97 
       
    98     #define COMPONENT_TRACE_THIS_FILE
       
    99 
       
   100     #define PANIC_IF_FALSE( a )
       
   101     #define PANIC_IF_TRUE( a )
       
   102     #define PANIC_ALWAYS
       
   103 
       
   104 #endif // _DEBUG
       
   105 */
       
   106 #endif // BM_DEBUG_H
       
   107 
       
   108 // End of File