voipplugins/ipapputils/voipeventlog/inc/voipeventloglogger.h
branchRCL_3
changeset 22 d38647835c2e
parent 0 a4daefaec16c
equal deleted inserted replaced
21:f742655b05bf 22:d38647835c2e
       
     1 /*
       
     2 * Copyright (c) 2007-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:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef VOIPEVENTLOGGER_H
       
    21 #define VOIPEVENTLOGGER_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32def.h>
       
    25 
       
    26 
       
    27 //-----------------------------------------------------------------------------
       
    28 //  USER LOGGING SETTINGS
       
    29 //-----------------------------------------------------------------------------
       
    30 
       
    31 #ifndef _DEBUG
       
    32 
       
    33 /***************************
       
    34 * Logging method variants:
       
    35 *   0 = No logging
       
    36 *   1 = Flogger
       
    37 *   2 = RDebug
       
    38 ***************************/ 
       
    39 
       
    40 #define VELAPI_LOGGING_METHOD  0   // UREL BUILD
       
    41 
       
    42 #else
       
    43 
       
    44 #ifdef __WINS__
       
    45 #define VELAPI_LOGGING_METHOD  2   // UDEB BUILD, WINS
       
    46 #else
       
    47 #define VELAPI_LOGGING_METHOD  2   // UDEB BUILD, HW
       
    48 #endif // __WINS__
       
    49 
       
    50 #endif // _DEBUG
       
    51 
       
    52 
       
    53 //-----------------------------------------------------------------------------
       
    54 //  LOGGING SETTINGS (DO NOT EDIT)
       
    55 //-----------------------------------------------------------------------------
       
    56 
       
    57 #if VELAPI_LOGGING_METHOD == 1      // Flogger
       
    58 
       
    59 #include <flogger.h>
       
    60 _LIT(KVELAPILogFolder,"VELAPI");
       
    61 _LIT(KVELAPIAPILogFile,"VELAPI.TXT");
       
    62 
       
    63 #elif VELAPI_LOGGING_METHOD == 2    // RDebug
       
    64 
       
    65 #include <e32svr.h>
       
    66 
       
    67 #endif
       
    68 
       
    69 
       
    70 //-----------------------------------------------------------------------------
       
    71 //  LOGGING MACROs (DO NOT EDIT)
       
    72 //
       
    73 //  USE THESE MACROS IN YOUR CODE
       
    74 //-----------------------------------------------------------------------------
       
    75 
       
    76 #if VELAPI_LOGGING_METHOD == 1      // Flogger
       
    77 
       
    78 #define VELLOGSTRING(AA)           { RFileLogger::Write(KXSPSAPILogFolder(),KXSPSAPILogFile(),EFileLoggingModeAppend, _L(AA) ); }
       
    79 #define VELLOGSTRING2(AA,BB)       { RFileLogger::WriteFormat(KXSPSAPILogFolder(),KXSPSAPILogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(_L(AA)),BB); }
       
    80 #define VELLOGSTRING3(AA,BB,CC)    { RFileLogger::WriteFormat(KXSPSAPILogFolder(),KXSPSAPILogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(_L(AA)),BB,CC); }
       
    81 #define VELLOGSTRING4(AA,BB,CC,DD) { RFileLogger::WriteFormat(KXSPSAPILogFolder(),KXSPSAPILogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(_L(AA)),BB,CC,DD); }
       
    82 
       
    83 #elif VELAPI_LOGGING_METHOD == 2    // RDebug
       
    84 
       
    85 #define VELLOGSTRING(AA)           { RDebug::Print(_L(AA)); }
       
    86 #define VELLOGSTRING2(AA,BB)       { RDebug::Print(_L(AA),BB); }
       
    87 #define VELLOGSTRING3(AA,BB,CC)    { RDebug::Print(_L(AA),BB,CC); }
       
    88 #define VELLOGSTRING4(AA,BB,CC,DD) { RDebug::Print(_L(AA),BB,CC,DD); }
       
    89 
       
    90 #else   // XSPSAPI_LOGGING_METHOD == 0 or invalid -> Disable loggings
       
    91 
       
    92 #define VELLOGSTRING(AA)           // Example: XSPSLOGSTRING("Test");
       
    93 #define VELLOGSTRING2(AA,BB)       // Example: XSPSLOGSTRING("Test %d", aValue);
       
    94 #define VELLOGSTRING3(AA,BB,CC)    // Example: XSPSLOGSTRING("Test %d %d", aValue1, aValue2);
       
    95 #define VELLOGSTRING4(AA,BB,CC,DD) // Example: XSPSLOGSTRING("Test %d %d %d", aValue1, aValue2, aValue3);
       
    96 
       
    97 #endif  // VELAPI_LOGGING_METHOD
       
    98 
       
    99 #endif  // VELAPILOGGER_H