sipvoipprovider/inc/svplogger.h
changeset 2 7b872347d83b
parent 0 a4daefaec16c
equal deleted inserted replaced
1:bfb1de3eac8e 2:7b872347d83b
    25 _LIT( KComponent, "SVP" );
    25 _LIT( KComponent, "SVP" );
    26 #endif // COMPONENT
    26 #endif // COMPONENT
    27 
    27 
    28 #include <e32svr.h>
    28 #include <e32svr.h>
    29 #include <e32cmn.h>
    29 #include <e32cmn.h>
       
    30 #include "svpconsts.h"
    30 
    31 
    31 /*****************************************************
    32 /*****************************************************
    32 * Format string for adding component to prints.
    33 * Format string for adding component to prints.
    33 * 
    34 * 
    34 * Parameters passed within macros from code are
    35 * Parameters passed within macros from code are
    39 /*
    40 /*
    40  *  Prints for text without params
    41  *  Prints for text without params
    41  */
    42  */
    42 static inline void PrintL( const TDesC& aStr )
    43 static inline void PrintL( const TDesC& aStr )
    43     {
    44     {
    44     HBufC* line = HBufC::NewLC( 256 );
    45     HBufC* line = HBufC::NewLC( KSvpMaxDebugBufferSize );
    45     TPtr ptr( line->Des() );
    46     TPtr ptr( line->Des() );
    46     ptr.Format( KSVPPrintFormatString(), &KComponent(), &aStr );   
    47     ptr.Format( KSVPPrintFormatString(), &KComponent(), &aStr );   
    47     RDebug::Print( line->Des() );
    48     RDebug::Print( line->Des() );
    48     CleanupStack::PopAndDestroy( line );
    49     CleanupStack::PopAndDestroy( line );
    49     }
    50     }
    55 /* 
    56 /* 
    56  * Prints for text with TInt as a param
    57  * Prints for text with TInt as a param
    57  */
    58  */
    58 static inline void PrintL( const TDesC& aStr, const TInt& aTInt )
    59 static inline void PrintL( const TDesC& aStr, const TInt& aTInt )
    59     {
    60     {
    60     HBufC* line1 = HBufC::NewLC( 256 );
    61     HBufC* line1 = HBufC::NewLC( KSvpMaxDebugBufferSize );
    61     TPtr ptr1( line1->Des() );
    62     TPtr ptr1( line1->Des() );
    62     ptr1.Format( aStr, aTInt );
    63     ptr1.Format( aStr, aTInt );
    63     
    64     
    64     HBufC* line2 = HBufC::NewLC( 256 );
    65     HBufC* line2 = HBufC::NewLC( KSvpMaxDebugBufferSize );
    65     TPtr ptr2( line2->Des() );
    66     TPtr ptr2( line2->Des() );
    66     ptr2.Format( KSVPPrintFormatString(), &KComponent(), line1 );   
    67     ptr2.Format( KSVPPrintFormatString(), &KComponent(), line1 );   
    67     RDebug::Print( line2->Des() );
    68     RDebug::Print( line2->Des() );
    68     CleanupStack::PopAndDestroy( 2 );
    69     CleanupStack::PopAndDestroy( 2 );
    69     }
    70     }
    75 /*
    76 /*
    76  * Prints for text with any pointer as a param
    77  * Prints for text with any pointer as a param
    77  */
    78  */
    78 static inline void PrintL( const TDesC& aStr, const TAny* aPtr )
    79 static inline void PrintL( const TDesC& aStr, const TAny* aPtr )
    79     {
    80     {
    80     HBufC* line1 = HBufC::NewLC( 256 );
    81     HBufC* line1 = HBufC::NewLC( KSvpMaxDebugBufferSize );
    81     TPtr ptr1( line1->Des() );
    82     TPtr ptr1( line1->Des() );
    82     ptr1.Format( aStr, aPtr );
    83     ptr1.Format( aStr, aPtr );
    83     
    84     
    84     HBufC* line2 = HBufC::NewLC( 256 );
    85     HBufC* line2 = HBufC::NewLC( KSvpMaxDebugBufferSize );
    85     TPtr ptr2( line2->Des() );
    86     TPtr ptr2( line2->Des() );
    86     ptr2.Format( KSVPPrintFormatString(), &KComponent(), line1 ); 
    87     ptr2.Format( KSVPPrintFormatString(), &KComponent(), line1 ); 
    87     RDebug::Print( line2->Des() );
    88     RDebug::Print( line2->Des() );
    88     CleanupStack::PopAndDestroy( 2 );
    89     CleanupStack::PopAndDestroy( 2 );
    89     }
    90     }
    97  */
    98  */
    98 static inline void PrintL( const TDesC& aStr,
    99 static inline void PrintL( const TDesC& aStr,
    99                            const TInt& aTInt1,
   100                            const TInt& aTInt1,
   100                            const TInt& aTInt2 )
   101                            const TInt& aTInt2 )
   101     {
   102     {
   102     HBufC* line1 = HBufC::NewLC( 256 );
   103     HBufC* line1 = HBufC::NewLC( KSvpMaxDebugBufferSize );
   103     TPtr ptr1( line1->Des() );
   104     TPtr ptr1( line1->Des() );
   104     ptr1.Format( aStr, aTInt1, aTInt2 );
   105     ptr1.Format( aStr, aTInt1, aTInt2 );
   105         
   106         
   106     HBufC* line2 = HBufC::NewLC( 256 );
   107     HBufC* line2 = HBufC::NewLC( KSvpMaxDebugBufferSize );
   107     TPtr ptr2( line2->Des() );
   108     TPtr ptr2( line2->Des() );
   108     ptr2.Format( KSVPPrintFormatString(), &KComponent(), line1 );   
   109     ptr2.Format( KSVPPrintFormatString(), &KComponent(), line1 );   
   109     RDebug::Print( line2->Des() );
   110     RDebug::Print( line2->Des() );
   110     CleanupStack::PopAndDestroy( 2 );
   111     CleanupStack::PopAndDestroy( 2 );
   111     }
   112     }
   121  */
   122  */
   122 static inline void PrintL( const TDesC& aStr1,
   123 static inline void PrintL( const TDesC& aStr1,
   123                            const TInt& aTInt,
   124                            const TInt& aTInt,
   124                            const TDesC* aStr2 )
   125                            const TDesC* aStr2 )
   125     {
   126     {
   126     HBufC* line1 = HBufC::NewLC( 256 );
   127     HBufC* line1 = HBufC::NewLC( KSvpMaxDebugBufferSize );
   127     TPtr ptr1( line1->Des() );
   128     TPtr ptr1( line1->Des() );
   128     ptr1.Format( aStr1, aTInt, aStr2 );
   129     ptr1.Format( aStr1, aTInt, aStr2 );
   129         
   130         
   130     HBufC* line2 = HBufC::NewLC( 256 );
   131     HBufC* line2 = HBufC::NewLC( KSvpMaxDebugBufferSize );
   131     TPtr ptr2( line2->Des() );
   132     TPtr ptr2( line2->Des() );
   132     ptr2.Format( KSVPPrintFormatString(), &KComponent(), line1 );   
   133     ptr2.Format( KSVPPrintFormatString(), &KComponent(), line1 );   
   133     RDebug::Print( line2->Des() );
   134     RDebug::Print( line2->Des() );
   134     CleanupStack::PopAndDestroy( 2 );
   135     CleanupStack::PopAndDestroy( 2 );
   135     }
   136     }