devicemgmtnotifications/dmdevdialogclient/inc/dmdevdialogclientdebug.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) 2009 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: Implementation of Dm device dialog client
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
#ifndef DEVDIALOG_CLIENT_DEBUG_H_
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    19
#define DEVDIALOG_CLIENT_DEBUG_H_
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    20
#ifdef _DEBUG
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    21
   #ifdef _DEVDIALOG_DEBUG
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    22
#endif
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    23
        #include <e32std.h>
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    24
        #include <f32file.h>
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    25
        #include <flogger.h>
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    26
        #include <e32svr.h>
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    27
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    28
        _LIT( KLogFile, "devdiag.log" );
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    29
        _LIT( KLogDirFullName, "c:\\logs\\" );
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    30
        _LIT( KLogDir, "DMDD" );
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    31
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    32
        inline void FWrite (TRefByValue<const TDesC> aFmt,...)
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    33
            {
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    34
            VA_LIST list;
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    35
            VA_START( list, aFmt );
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    36
            RFileLogger::WriteFormat( KLogDir,KLogFile,EFileLoggingModeAppend ,TPtrC(aFmt) ,list );
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    37
            }
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    38
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    39
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    40
        #ifdef __DEVDIALOG_DEBUG_RDEBUG 
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    41
            #ifndef __GNUC__          
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    42
                #define FLOG            RDebug::Print
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    43
            #else   // __GNUC__       
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    44
                #define FLOG(arg...)    RDebug::Print(arg);
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    45
            #endif // __GNUC__        
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    46
        #else //__DEVDIALOG_DEBUG_RDEBUG
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    47
            #ifndef __GNUC__          
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    48
                #define FLOG            FWrite
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    49
            #else   // __GNUC__       
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    50
                #define FLOG(arg...)    FWrite(arg);
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    51
            #endif // __GNUC__        
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    52
        #endif // __DEVDIALOG_DEBUG_RDEBUG
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    53
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    54
    #else   // _DEVDIALOG_DEBUG
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    55
        #ifndef __GNUC__
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    56
            #define FLOG
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    57
        #else
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    58
            #define FLOG(arg...)
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    59
        #endif // __GNUC__
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    60
    #endif // _DEVDIALOG_DEBUG
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    61
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    62
2e64dc50f295 201025_02
hgs
parents:
diff changeset
    63
#endif /*FMSCLIENTDEBUG_H_*/