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