datasourceadaptation/gpsdatasourceadaptation/common/inc/psylogging.h
changeset 0 9cfd9a3ee49c
equal deleted inserted replaced
-1:000000000000 0:9cfd9a3ee49c
       
     1 /*
       
     2 * Copyright (c) 2007-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:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef BTGPSLOGGING_H
       
    21 #define BTGPSLOGGING_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <flogger.h>
       
    25 #include <f32file.h>
       
    26 
       
    27 
       
    28 // CONSTANTS
       
    29 
       
    30 // MACROS
       
    31 #ifdef _DEBUG
       
    32 _LIT( KLoggingFolder, "lbs" );
       
    33 _LIT( KLoggingFile, "psylogging.txt" );
       
    34 _LIT( KLoggingFullName, "c:\\logs\\lbs\\psylogging.txt");
       
    35 
       
    36 #define CLEARTRACELOG \
       
    37     {\
       
    38     RFs fs; \
       
    39     User::LeaveIfError(fs.Connect());\
       
    40     CleanupClosePushL(fs);\
       
    41     CFileMan* fileMan=CFileMan::NewL(fs); \
       
    42     fileMan->Delete(KLoggingFullName); \
       
    43     delete fileMan; \
       
    44     CleanupStack::PopAndDestroy(&fs);\
       
    45     }
       
    46     
       
    47 #define TRACETEXT( S1 )         { RFileLogger::Write( KLoggingFolder(),\
       
    48 KLoggingFile(), EFileLoggingModeAppend, S1 ); }
       
    49 
       
    50 #define TRACESTRING( S1 )       { _LIT( tempLogDes, S1 ); RFileLogger::Write(\
       
    51 KLoggingFolder(), KLoggingFile(), EFileLoggingModeAppend, tempLogDes()); }
       
    52 
       
    53 #define TRACESTRING2( S1, S2 )  { _LIT( tempLogDes, S1 ); RFileLogger::\
       
    54 WriteFormat( KLoggingFolder(), KLoggingFile(), EFileLoggingModeAppend,\
       
    55 TRefByValue<const TDesC>( tempLogDes()), S2 ); }
       
    56 
       
    57 
       
    58 #define TRACESTRING8_old( S1 )          { _LIT8( tempLogDes, S1 ); RFileLogger::\
       
    59 Write( KLoggingFolder(), KLoggingFile(), EFileLoggingModeAppend, tempLogDes());}
       
    60 
       
    61 #define TRACESTRING8( S1 )          { RFileLogger::\
       
    62 Write( KLoggingFolder(), KLoggingFile(), EFileLoggingModeAppend, S1);}
       
    63 
       
    64 #define TRACESTRING28( S1, S2 )     { _LIT8( tempLogDes, S1 ); RFileLogger::\
       
    65 WriteFormat( KLoggingFolder(), KLoggingFile(), EFileLoggingModeAppend,\
       
    66 TRefByValue<const TDesC8>( tempLogDes()), S2 ); }
       
    67 
       
    68 #define TRACESTRING38( S1, S2, S3 ) { _LIT8( tempLogDes, S1 ); RFileLogger::\
       
    69 WriteFormat( KLoggingFolder(), KLoggingFile(), EFileLoggingModeAppend,\
       
    70 TRefByValue<const TDesC8>( tempLogDes()), S2, S3 ); }
       
    71 
       
    72 //
       
    73 #define BTGPSLOGSTRING2 TRACESTRING2;
       
    74 #define BTGPSLOGSTRING TRACESTRING;
       
    75 #define BTGPSLOGTEXT TRACETEXT;
       
    76 //
       
    77 
       
    78 #else   // _DEBUG
       
    79 #define CLEARTRACELOG 
       
    80 #define TRACETEXT( S1 )
       
    81 #define TRACESTRING( S1 )
       
    82 #define TRACESTRING2( S1, S2 )
       
    83 #define TRACESTRING8( S1 )
       
    84 #define TRACESTRING28( S1, S2 )
       
    85 #define TRACESTRING38( S1, S2, S3 )
       
    86 #endif  // _DEBUG
       
    87 
       
    88 // DATA TYPES
       
    89 
       
    90 // FUNCTION PROTOTYPES
       
    91 
       
    92 // FORWARD DECLARATIONS
       
    93 
       
    94 // CLASS DECLARATION
       
    95 
       
    96 #endif  // BTGPSLOGGING_H
       
    97 // End of File