telutils/telephonyservice/inc/telsrvlogger.h
changeset 0 ff3b6d0fd310
equal deleted inserted replaced
-1:000000000000 0:ff3b6d0fd310
       
     1 /*
       
     2 * Copyright (c) 2006-2007 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:  Provides macros for logging
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef TELSRVLOGGER_H_
       
    20 #define TELSRVLOGGER_H_
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32def.h>
       
    24 
       
    25 
       
    26 //-----------------------------------------------------------------------------
       
    27 //  USER LOGGING SETTINGS
       
    28 //-----------------------------------------------------------------------------
       
    29 
       
    30 #ifndef _DEBUG
       
    31 
       
    32 /***************************
       
    33 * Logging method variants:
       
    34 *   0 = No logging
       
    35 *   1 = Flogger
       
    36 *   2 = RDebug
       
    37 ***************************/ 
       
    38 
       
    39 #define TS_LOGGING_METHOD      0   // UREL BUILD
       
    40 
       
    41 #else
       
    42 
       
    43 #ifdef __WINS__
       
    44 #define TS_LOGGING_METHOD      2   // UDEB BUILD, WINS
       
    45 #else
       
    46 #define TS_LOGGING_METHOD      2   // UDEB BUILD, HW
       
    47 #endif // __WINS__
       
    48 
       
    49 #endif // _DEBUG
       
    50 
       
    51 
       
    52 //-----------------------------------------------------------------------------
       
    53 //  LOGGING SETTINGS (DO NOT EDIT)
       
    54 //-----------------------------------------------------------------------------
       
    55 
       
    56 #if TS_LOGGING_METHOD == 1      // Flogger
       
    57 
       
    58 #include <flogger.h>
       
    59 _LIT(KTSLogFolder,"TS");
       
    60 _LIT(KTSLogFile,"telsrvlog.txt");
       
    61 
       
    62 #elif TS_LOGGING_METHOD == 2    // RDebug
       
    63 
       
    64 #include <e32svr.h>
       
    65 
       
    66 #endif
       
    67 
       
    68 
       
    69 //-----------------------------------------------------------------------------
       
    70 //  LOGGING MACROs (DO NOT EDIT)
       
    71 //
       
    72 //  USE THESE MACROS IN YOUR CODE
       
    73 //-----------------------------------------------------------------------------
       
    74 
       
    75 #if TS_LOGGING_METHOD == 1      // Flogger
       
    76 
       
    77 #define TSLOGSTRING(AA)           { RFileLogger::Write(KTSLogFolder(),KTSLogFile(),EFileLoggingModeAppend, _L(AA) ); }
       
    78 #define TSLOGSTRING2(AA,BB)       { RFileLogger::WriteFormat(KTSLogFolder(),KTSLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(_L(AA)),BB); }
       
    79 
       
    80 
       
    81 #elif TS_LOGGING_METHOD == 2    // RDebug
       
    82 
       
    83 #define TSLOGSTRING(AA)           { RDebug::Print(_L(AA)); }
       
    84 #define TSLOGSTRING2(AA,BB)       { RDebug::Print(_L(AA),BB); }
       
    85 
       
    86 
       
    87 #else   // TS_LOGGING_METHOD == 0 or invalid -> Disable loggings
       
    88 
       
    89 #define TSLOGSTRING(AA)           // Example: TSLOGSTRING("Test");
       
    90 #define TSLOGSTRING2(AA,BB)       // Example: TSLOGSTRING("Test %d", aValue);
       
    91 
       
    92 #endif  // TS_LOGGING_METHOD
       
    93 
       
    94 
       
    95 #endif /* TELSRVLOGGER_H_ */