genericpositioningplugins/locationnpppsy/inc/npppsylogging.h
changeset 0 667063e416a2
equal deleted inserted replaced
-1:000000000000 0:667063e416a2
       
     1 /*
       
     2 * Copyright (c) 2006 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:  Logging macros
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef NPPPSYLOGGING_H
       
    20 #define NPPPSYLOGGING_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <flogger.h>
       
    24 #include <f32file.h>
       
    25 
       
    26 
       
    27 // CONSTANTS
       
    28 
       
    29 // MACROS
       
    30 #ifdef _DEBUG
       
    31 _LIT( KLoggingFolder, "NppPsy" );
       
    32 _LIT( KLoggingFile, "log.txt" );
       
    33 _LIT( KLoggingFullName, "c:\\logs\\NppPsy\\log.TXT" );
       
    34 
       
    35 #define CLEARTRACELOG \
       
    36     {RFs fs;fs.Connect();CFileMan* fileMan = CFileMan::NewL( fs ); \
       
    37     fileMan->Delete( KLoggingFullName ); delete fileMan; fs.Close();\
       
    38     }
       
    39     
       
    40 #define TRACETEXT( S1 )         { RFileLogger::Write( KLoggingFolder(),\
       
    41 KLoggingFile(), EFileLoggingModeAppend, S1 ); }
       
    42 
       
    43 #define TRACESTRING( S1 )       { \
       
    44     _LIT( tempLogDes, S1 ); \
       
    45     RFileLogger::Write( KLoggingFolder(), KLoggingFile(), \
       
    46     EFileLoggingModeAppend, tempLogDes() ); \
       
    47     }
       
    48 
       
    49 #define TRACESTRING2( S1, S2 )  { \
       
    50     _LIT( tempLogDes, S1 ); \
       
    51     RFileLogger::WriteFormat( KLoggingFolder(), KLoggingFile(), \
       
    52     EFileLoggingModeAppend, TRefByValue < const TDesC>( tempLogDes() ), S2 ); \
       
    53     }
       
    54 
       
    55 
       
    56 #else   // _DEBUG
       
    57 #define CLEARTRACELOG 
       
    58 #define TRACETEXT( S1 )
       
    59 #define TRACESTRING( S1 )
       
    60 #define TRACESTRING2( S1, S2 )
       
    61 #endif  // _DEBUG
       
    62 
       
    63 // DATA TYPES
       
    64 
       
    65 // FUNCTION PROTOTYPES
       
    66 
       
    67 // FORWARD DECLARATIONS
       
    68 
       
    69 // CLASS DECLARATION
       
    70 
       
    71 #endif  // NPPPSYLOGGING_H
       
    72 // End of File