pnpmobileservices/pnpms/PnP/recnhwr/PnpRecnhwrLogger.h
changeset 0 3ce708148e4d
equal deleted inserted replaced
-1:000000000000 0:3ce708148e4d
       
     1 /*
       
     2 * Copyright (c) 2004 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:  This file defines logging interface macros
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __LOGGER_H__
       
    20 #define __LOGGER_H__
       
    21 
       
    22 #ifdef _DEBUG
       
    23     #define LOGGING_ENABLED
       
    24 #endif
       
    25 #ifdef LOGGING_ENABLED          // This must be enabled to use logging system
       
    26 
       
    27 #define LOGGER_LOGGING          // Log to Logger
       
    28 
       
    29 
       
    30 
       
    31 #ifdef LOGGER_LOGGING
       
    32 
       
    33 //  INCLUDES
       
    34 #include <flogger.h>
       
    35 
       
    36 // LOG SETTINGS 
       
    37 _LIT( KPnpLogFolder, "PnP" );
       
    38 _LIT( KPnpLogFile, "RecNhwr.TXT" );
       
    39 
       
    40 #endif
       
    41 
       
    42 // CONSTANTS  
       
    43 // None.
       
    44 
       
    45 // MACROS
       
    46 /*
       
    47 -----------------------------------------------------------------------------
       
    48 
       
    49     INTERNAL MACROs. 
       
    50 
       
    51     DO NOT USE THESE DIRECTLY !!! 
       
    52     SEE EXTERNAL MACROS
       
    53 
       
    54 -----------------------------------------------------------------------------
       
    55 */
       
    56 
       
    57 #ifdef LOGGER_LOGGING
       
    58 #define INTRLOGTEXT( AAA )                  { RFileLogger::Write( KPnpLogFolder(), KPnpLogFile(), EFileLoggingModeAppend, AAA ); }
       
    59 #define INTRLOGSTRING( AAA )                { _LIT( tempLogDes, AAA ); RFileLogger::Write( KPnpLogFolder(), KPnpLogFile(), EFileLoggingModeAppend, tempLogDes()); }
       
    60 #define INTRLOGSTRING2( AAA, BBB )            { _LIT( tempLogDes, AAA ); RFileLogger::WriteFormat( KPnpLogFolder(), KPnpLogFile(), EFileLoggingModeAppend, TRefByValue<const TDesC>( tempLogDes()), BBB ); }
       
    61 #define INTRLOGSTRING3( AAA, BBB, CCC )        { _LIT( tempLogDes, AAA ); RFileLogger::WriteFormat( KPnpLogFolder(), KPnpLogFile(), EFileLoggingModeAppend, TRefByValue<const TDesC>( tempLogDes()), BBB, CCC ); }
       
    62 #else
       
    63 #define INTRLOGTEXT( AAA )
       
    64 #define INTRLOGSTRING( AAA )
       
    65 #define INTRLOGSTRING2( AAA, BBB )
       
    66 #define INTRLOGSTRING3( AAA, BBB, CCC )
       
    67 #endif
       
    68 
       
    69 /*
       
    70 -----------------------------------------------------------------------------
       
    71 
       
    72     EXTERNAL MACROs
       
    73 
       
    74     USE THESE MACROS IN YOUR CODE !
       
    75 
       
    76 -----------------------------------------------------------------------------
       
    77 */
       
    78 
       
    79 
       
    80 #define LOGTEXT( AAA )                { \
       
    81                                     INTRLOGTEXT( AAA ); \
       
    82                                     }   // Example: LOGTEXT( own_desc );
       
    83 
       
    84 #define LOGSTRING( AAA )            { \
       
    85                                     INTRLOGSTRING( AAA ); \
       
    86                                     }   // Example: LOGSTRING( "Test" );
       
    87 
       
    88 #define LOGSTRING2( AAA, BBB )        { \
       
    89                                     INTRLOGSTRING2( AAA, BBB ); \
       
    90                                     }  // Example: LOGSTRING( "Test %i", aValue );
       
    91 
       
    92 #define LOGSTRING3( AAA, BBB, CCC )    { \
       
    93                                     INTRLOGSTRING3( AAA, BBB, CCC ); \
       
    94                                     } // Example: LOGSTRING( "Test %i %i", aValue1, aValue2 );
       
    95 
       
    96 
       
    97 #else   // LOGGING_ENABLED
       
    98 
       
    99 #define LOGTEXT( AAA ) 
       
   100 #define LOGSTRING( AAA ) 
       
   101 #define LOGSTRING2( AAA, BBB )    
       
   102 #define LOGSTRING3( AAA, BBB, CCC )    
       
   103 
       
   104 #endif  // LOGGING_ENABLED
       
   105 
       
   106 // DATA TYPES
       
   107 // None.
       
   108 
       
   109 // FUNCTION PROTOTYPES
       
   110 // None.
       
   111 
       
   112 // FORWARD DECLARATIONS
       
   113 // None.
       
   114 
       
   115 // CLASS DECLARATION
       
   116 // None.
       
   117 
       
   118 #endif  // __LOGGER_H__