fotaapplication/FotaEngine/INC/fotaenginedebug.h
author hgs
Tue, 13 Jul 2010 09:51:41 +0530
changeset 51 2e64dc50f295
permissions -rw-r--r--
201025_02
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
51
2e64dc50f295 201025_02
hgs
parents:
diff changeset
     1
/*
2e64dc50f295 201025_02
hgs
parents:
diff changeset
     2
* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). 
2e64dc50f295 201025_02
hgs
parents:
diff changeset
     3
* All rights reserved.
2e64dc50f295 201025_02
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
2e64dc50f295 201025_02
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
2e64dc50f295 201025_02
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
2e64dc50f295 201025_02
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
2e64dc50f295 201025_02
hgs
parents:
diff changeset
     8
*
2e64dc50f295 201025_02
hgs
parents:
diff changeset
     9
* Initial Contributors:
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    11
*
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    12
* Contributors:
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    13
*
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    14
* Description:   This file defines logging macros 
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    15
*
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    16
*/
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    17
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    18
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    19
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    20
#ifndef FOTADEBUG_H
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    21
#define FOTADEBUG_H
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    22
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    23
    // IMPORT_C static TInt Print(TRefByValue<const TDesC> aFmt,...);
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    24
    #ifdef _FOTA_DEBUG
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    25
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    26
        #include <e32std.h>
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    27
        #include <f32file.h>
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    28
        #include <flogger.h>
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    29
        #include <e32svr.h>
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    30
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    31
        _LIT( KLogFile, "fotaengine.log" );
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    32
        _LIT( KLogDirFullName, "c:\\logs\\" );
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    33
        _LIT( KLogDir, "fota" );
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    34
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    35
        inline void FWrite (TRefByValue<const TDesC> aFmt,...)
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    36
            {
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    37
            VA_LIST list;
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    38
            VA_START( list, aFmt );
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    39
            RFileLogger::WriteFormat( KLogDir,KLogFile,EFileLoggingModeAppend ,TPtrC(aFmt) ,list );
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    40
            }
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    41
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    42
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    43
        #ifdef _FOTA_DEBUG_RDEBUG 
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    44
            #ifndef __GNUC__          
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    45
                #define FLOG            RDebug::Print
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    46
            #else   // __GNUC__       
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    47
                #define FLOG(arg...)    RDebug::Print(arg);
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    48
            #endif // __GNUC__        
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    49
        #else // _FOTA_DEBUG_RDEBUG
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    50
            #ifndef __GNUC__          
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    51
                #define FLOG            FWrite
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    52
            #else   // __GNUC__       
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    53
                #define FLOG(arg...)    FWrite(arg);
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    54
            #endif // __GNUC__        
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    55
        #endif // _FOTA_DEBUG_RDEBUG
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    56
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    57
    #else   // _FOTA_DEBUG    
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    58
        #ifndef __GNUC__
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    59
            #define FLOG
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    60
        #else
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    61
            #define FLOG(arg...)
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    62
        #endif // __GNUC__
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    63
    #endif // _FOTA_DEBUG
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    64
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    65
#endif      // FOTADEBUG_H
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    66
            
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    67
// End of File