datasourcemodules/locationapesuplpsy/inc/suplpsylogging.h
changeset 0 9cfd9a3ee49c
equal deleted inserted replaced
-1:000000000000 0:9cfd9a3ee49c
       
     1 /*
       
     2 * Copyright (c) 2005 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 SUPLPSYLOGGING_H
       
    20 #define SUPLPSYLOGGING_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <flogger.h>
       
    24 #include <f32file.h>
       
    25 
       
    26 
       
    27 // CONSTANTS
       
    28 
       
    29 // MACROS
       
    30 _LIT( KLoggingFolder, "suplpsy" );
       
    31 _LIT( KLoggingFile, "log.txt" );
       
    32 _LIT( KLoggingFullName, "c:\\logs\\suplpsy\\log.TXT" );
       
    33 
       
    34 #define CLEARTRACELOG \
       
    35     { \
       
    36     RFs fs;fs.Connect(); \
       
    37     CFileMan* fileMan = CFileMan::NewL( fs ); \
       
    38     fileMan->Delete( KLoggingFullName ); \
       
    39     delete fileMan; \
       
    40     fs.Close();\
       
    41     }
       
    42     
       
    43 #define TRACETEXT( S1 ) \
       
    44     { \
       
    45     RFileLogger::Write( \
       
    46         KLoggingFolder(), \
       
    47         KLoggingFile(), \
       
    48         EFileLoggingModeAppend, \
       
    49         S1 ); \
       
    50     }
       
    51 
       
    52 #define TRACESTRING( S1 ) \
       
    53     { \
       
    54     _LIT( tempLogDes, S1 ); \
       
    55     RFileLogger::Write( \
       
    56         KLoggingFolder(), \
       
    57         KLoggingFile(), \
       
    58         EFileLoggingModeAppend, \
       
    59         tempLogDes() ); \
       
    60     }
       
    61 
       
    62 #define TRACESTRING2( S1, S2 ) \
       
    63     { \
       
    64     _LIT( tempLogDes, S1 ); \
       
    65     RFileLogger::WriteFormat( \
       
    66         KLoggingFolder(), \
       
    67         KLoggingFile(), \
       
    68         EFileLoggingModeAppend,\
       
    69         TRefByValue < const TDesC >( tempLogDes() ), S2 ); \
       
    70     }
       
    71 
       
    72 #define TRACEHEX2( PTR, LEN ) \
       
    73     { \
       
    74     RFileLogger::HexDump( \
       
    75         KLoggingFolder(), \
       
    76         KLoggingFile(), \
       
    77         EFileLoggingModeAppend, \
       
    78         NULL, \
       
    79         NULL, \
       
    80         PTR, \
       
    81         LEN ); \
       
    82     }
       
    83 
       
    84 
       
    85 
       
    86 // DATA TYPES
       
    87 
       
    88 // FUNCTION PROTOTYPES
       
    89 
       
    90 // FORWARD DECLARATIONS
       
    91 
       
    92 // CLASS DECLARATION
       
    93 
       
    94 #endif  // SUPLPSYLOGGING_H
       
    95 // End of File