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