phoneclientserver/callui/inc/cauiengine/cauilogger.h
changeset 51 12bc758d6a02
parent 48 78df25012fda
child 53 25b8d29b7c59
equal deleted inserted replaced
48:78df25012fda 51:12bc758d6a02
     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:  Logger headerfile for CallUi
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CAUILOGGER_H
       
    21 #define CAUILOGGER_H
       
    22 
       
    23 /* 
       
    24 -----------------------------------------------------------------------------
       
    25     LOG SELECTION
       
    26 -----------------------------------------------------------------------------
       
    27 */
       
    28 #ifndef _DEBUG
       
    29     // UREL BUILD:
       
    30     #define CAUI_LOGGING_METHOD  0   // No logging in UREL builds
       
    31 #else
       
    32     // UDEB BUILD:
       
    33     #define CAUI_LOGGING_METHOD  1   // 0 = No logging, 
       
    34                                         // 1 = Flogger, 
       
    35                                         // 2 = RDebug
       
    36 #endif //_DEBUG
       
    37 
       
    38 
       
    39 #if CAUI_LOGGING_METHOD > 0
       
    40     #define CAUI_LOGGING_ENABLED     // This is for backward compatibility
       
    41 #endif //CAUI_LOGGING_METHOD 
       
    42 
       
    43 /* 
       
    44 -----------------------------------------------------------------------------
       
    45     FLOGGER SETTINGS
       
    46 -----------------------------------------------------------------------------
       
    47 */
       
    48 #if CAUI_LOGGING_METHOD == 1      // Flogger
       
    49 
       
    50     #include <flogger.h>
       
    51 
       
    52     _LIT(KCAUILogFolder, "TF");
       
    53     _LIT(KCAUILogFile, "TFLOG.TXT");
       
    54 
       
    55 #elif CAUI_LOGGING_METHOD == 2    // RDebug
       
    56 
       
    57     #include <e32svr.h>
       
    58 
       
    59 #endif //CAUI_LOGGING_METHOD
       
    60 
       
    61 
       
    62 /*
       
    63 -----------------------------------------------------------------------------
       
    64     LOGGING MACROs
       
    65 
       
    66     USE THESE MACROS IN YOUR CODE !
       
    67 -----------------------------------------------------------------------------
       
    68 */
       
    69 
       
    70 
       
    71 #if CAUI_LOGGING_METHOD == 1      // Flogger
       
    72 
       
    73 #define CAUILOGTEXT(AAA) /*lint -save -e960 */              { RFileLogger::Write(KCAUILogFolder(),KCAUILogFile(),EFileLoggingModeAppend,AAA); } /*lint -restore */
       
    74 #define CAUILOGSTRING(AAA) /*lint -save -e960 */           { _LIT(tempLogDes,AAA); RFileLogger::Write(KCAUILogFolder(),KCAUILogFile(),EFileLoggingModeAppend,tempLogDes()); } /*lint -restore */
       
    75 #define CAUILOGSTRING2(AAA,BBB) /*lint -save -e960 -e437 */       { _LIT(tempLogDes,AAA); RFileLogger::WriteFormat(KCAUILogFolder(),KCAUILogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB); } /*lint -restore */
       
    76 #define CAUILOGSTRING3(AAA,BBB,CCC) /*lint -save -e960 */   { _LIT(tempLogDes,AAA); RFileLogger::WriteFormat(KCAUILogFolder(),KCAUILogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC); } /*lint -restore */
       
    77 
       
    78 #elif CAUI_LOGGING_METHOD == 2    // RDebug
       
    79 
       
    80 #define CAUILOGTEXT(AAA)              RDebug::Print(AAA);
       
    81 #define CAUILOGSTRING(AAA)            RDebug::Print(_L(AAA));
       
    82 #define CAUILOGSTRING2(AAA,BBB)       RDebug::Print(_L(AAA),BBB);
       
    83 #define CAUILOGSTRING3(AAA,BBB,CCC)   RDebug::Print(_L(AAA),BBB,CCC);
       
    84 
       
    85 #else    // CAUI_LOGGING_METHOD == 0 or invalid
       
    86 
       
    87 // Example: CAUILOGTEXT(own_desc);
       
    88 #define CAUILOGTEXT(AAA)              
       
    89 // Example: CAUILOGSTRING("Test");
       
    90 #define CAUILOGSTRING(AAA)            
       
    91 // Example: CAUILOGSTRING("Test %i", aValue);
       
    92 #define CAUILOGSTRING2(AAA,BBB)       
       
    93 // Example: CAUILOGSTRING("Test %i %i", aValue1, aValue2);
       
    94 #define CAUILOGSTRING3(AAA,BBB,CCC)   
       
    95 
       
    96 #endif  // CAUI_LOGGING_METHOD
       
    97 
       
    98 #endif    // CAUILOGGER_H
       
    99             
       
   100 // End of File