fotaapplication/fotaserver/fmserver/inc/fmsdebug.h
branchRCL_3
changeset 26 19bba8228ff0
parent 0 b497e44ab2fc
equal deleted inserted replaced
25:b183ec05bd8c 26:19bba8228ff0
       
     1 /*
       
     2 * Copyright (c) 2009 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: Implementation of fotaserver component
       
    15 * 	This is part of fotaapplication.
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef FMSDEBUG_H_
       
    20 #define FMSDEBUG_H_
       
    21 
       
    22 	#ifdef _DEBUG
       
    23 	#define _FOTA_DEBUG
       
    24 	#endif
       
    25 
       
    26    #ifdef _FOTA_DEBUG
       
    27 
       
    28         #include <e32std.h>
       
    29         #include <f32file.h>
       
    30         #include <flogger.h>
       
    31         #include <e32svr.h>
       
    32 
       
    33         _LIT( KLogFile, "fmsserver.log" );
       
    34         _LIT( KLogDirFullName, "c:\\logs\\" );
       
    35         _LIT( KLogDir, "fota" );
       
    36 
       
    37         inline void FWrite (TRefByValue<const TDesC> aFmt,...)
       
    38             {
       
    39             VA_LIST list;
       
    40             VA_START( list, aFmt );
       
    41             RFileLogger::WriteFormat( KLogDir,KLogFile,EFileLoggingModeAppend ,TPtrC(aFmt) ,list );
       
    42             }
       
    43 
       
    44 
       
    45         #ifdef _FOTA_DEBUG_RDEBUG 
       
    46             #ifndef __GNUC__          
       
    47                 #define FLOG            RDebug::Print
       
    48             #else   // __GNUC__       
       
    49                 #define FLOG(arg...)    RDebug::Print(arg);
       
    50             #endif // __GNUC__        
       
    51         #else // _FOTA_DEBUG_RDEBUG
       
    52             #ifndef __GNUC__          
       
    53                 #define FLOG            FWrite
       
    54             #else   // __GNUC__       
       
    55                 #define FLOG(arg...)    FWrite(arg);
       
    56             #endif // __GNUC__        
       
    57         #endif // _FOTA_DEBUG_RDEBUG
       
    58 
       
    59     #else   // _FOTA_DEBUG    
       
    60         #ifndef __GNUC__
       
    61             #define FLOG
       
    62         #else
       
    63             #define FLOG(arg...)
       
    64         #endif // __GNUC__
       
    65     #endif // _FOTA_DEBUG
       
    66 
       
    67 
       
    68 #endif /*FMSDEBUG_H_*/