deviceupdatesui/deviceupdates/inc/DeviceUpdateDebug.h
changeset 42 aa33c2cb9a50
equal deleted inserted replaced
41:c742e1129640 42:aa33c2cb9a50
       
     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 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef FOTADEBUG_H
       
    21 #define FOTADEBUG_H
       
    22 
       
    23     // IMPORT_C static TInt Print(TRefByValue<const TDesC> aFmt,...);
       
    24 #if defined (__WINS__)
       
    25     #define _FOTA_DEBUG
       
    26     #define _FOTA_DEBUG_RDEBUG
       
    27 #else
       
    28     #define _FOTA_DEBUG
       
    29 #endif
       
    30     //#endif
       
    31     #ifdef _FOTA_DEBUG
       
    32 
       
    33 
       
    34         #include <e32std.h>
       
    35         #include <f32file.h>
       
    36         #include <flogger.h>
       
    37         #include <e32svr.h>
       
    38 
       
    39         _LIT( KLogFile, "deviceupdates.log" );
       
    40         _LIT( KLogDir, "fota" );
       
    41 
       
    42         inline void FWrite (TRefByValue<const TDesC> aFmt,...)
       
    43             {
       
    44             VA_LIST list;
       
    45             VA_START( list, aFmt );
       
    46             RFileLogger::WriteFormat( KLogDir,KLogFile,EFileLoggingModeAppend ,TPtrC(aFmt) ,list );
       
    47             }
       
    48 
       
    49         #ifdef _FOTA_DEBUG_RDEBUG 
       
    50             #ifndef __GNUC__          
       
    51                 #define FLOG            RDebug::Print
       
    52             #else   // __GNUC__       
       
    53                 #define FLOG(arg...)    RDebug::Print(arg);
       
    54             #endif // __GNUC__        
       
    55         #else // _FOTA_DEBUG_RDEBUG
       
    56             #ifndef __GNUC__          
       
    57                 #define FLOG            FWrite
       
    58             #else   // __GNUC__       
       
    59                 #define FLOG(arg...)    FWrite(arg);
       
    60             #endif // __GNUC__        
       
    61         #endif // _FOTA_DEBUG_RDEBUG
       
    62 
       
    63     #else   // _FOTA_DEBUG    
       
    64         #ifndef __GNUC__
       
    65             #define FLOG
       
    66         #else
       
    67             #define FLOG(arg...)
       
    68         #endif // __GNUC__
       
    69     #endif // _FOTA_DEBUG
       
    70 
       
    71 #endif      // FOTADEBUG_H
       
    72             
       
    73 // End of File