iaupdate/IAD/firmwareupdate/inc/iaupdatefwdebug.h
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2008 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:   This file defines logging macros for DM
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef IAUPDATEFWDEBUG_H
       
    22 #define IAUPDATEFWDEBUG_H
       
    23 
       
    24 //#ifdef _DEBUG
       
    25 // ===========================================================================
       
    26 //#ifdef __WINS__     // File logging for WINS
       
    27 // ===========================================================================
       
    28 #include <e32std.h>
       
    29 #include <f32file.h>
       
    30 #include <flogger.h>
       
    31 
       
    32 
       
    33 #ifdef _DEBUG
       
    34 
       
    35 _LIT( KLogFile, "fw.log" );
       
    36 _LIT( KLogDirFullName, "c:\\logs\\" );
       
    37 _LIT( KLogDir, "iaupdate" );
       
    38 
       
    39 #define FLOG( a )   { FPrint( _L(a) ); }
       
    40 #define FLOG_NUM( a, num ) { FPrint(_L(a), num ); }
       
    41 #define FTRACE( a ) { a; }
       
    42 #define FLOGSTR(a)  { FPrint(a); }
       
    43 
       
    44 // ===========================================================================
       
    45 // KNST #ifdef __WINS__     // File logging for WINS
       
    46 // ===========================================================================
       
    47 // Declare the FPrint function
       
    48 //
       
    49 inline void FPrint( const TRefByValue<const TDesC> aFmt, ... )
       
    50     {
       
    51     VA_LIST list;
       
    52     VA_START( list, aFmt );
       
    53     RFileLogger::WriteFormat( KLogDir,
       
    54                               KLogFile,
       
    55                               EFileLoggingModeAppend,
       
    56                               aFmt,
       
    57                               list );
       
    58     }
       
    59 
       
    60 #else
       
    61 
       
    62 #define FLOG( a )   
       
    63 #define FTRACE( a ) 
       
    64 #define FLOG_NUM( a, num ) 
       
    65 #define FLOGSTR(a)  
       
    66 
       
    67 #endif //_DEBUG
       
    68 
       
    69 /*
       
    70 // ===========================================================================
       
    71 #else               // RDebug logging for target HW
       
    72 // ===========================================================================
       
    73 #include <e32svr.h>
       
    74 
       
    75 #define FLOG( a )   { RDebug::Print( _L(a) ); }
       
    76 #define FTRACE( a ) { a; }
       
    77 
       
    78 // Declare the FPrint function
       
    79 //
       
    80 inline void FPrint( const TRefByValue<const TDesC> aFmt, ... )
       
    81     {
       
    82     VA_LIST list;
       
    83     VA_START( list, aFmt );
       
    84     TInt tmpInt = VA_ARG( list, TInt );
       
    85     TInt tmpInt2 = VA_ARG( list, TInt );
       
    86     TInt tmpInt3 = VA_ARG( list, TInt );
       
    87     VA_END( list );
       
    88     RDebug::Print( aFmt, tmpInt, tmpInt2, tmpInt3 );
       
    89     }
       
    90 
       
    91 //#endif //__WINS__
       
    92 
       
    93 
       
    94 // ===========================================================================
       
    95 #else // // No loggings --> Reduced binary size
       
    96 // ===========================================================================
       
    97 #define FLOG( a )
       
    98 #define FTRACE( a )
       
    99 */
       
   100 
       
   101 //#endif // _DEBUG
       
   102 
       
   103 #endif      // IAUPDATEFWDEBUG_H
       
   104             
       
   105 // End of File