phonesettings/pslncallimageplugin/Logger/PslnCallImagePluginLogger.h
changeset 0 5f000ab63145
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     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: 
       
    15 *       Macro definition file for logging.
       
    16 *
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 #ifndef PSLNCALLIMAGEPLUGINLOGGER_H
       
    23 #define PSLNCALLIMAGEPLUGINLOGGER_H
       
    24 
       
    25 #include "PslnCallImagePluginLoggingConf.h"
       
    26 #include <e32std.h>
       
    27 #include <flogger.h>
       
    28 #include <e32svr.h>
       
    29 
       
    30 _LIT( KLogsDir,                  "CALLIMAGE");
       
    31 _LIT( KLogFileName,              "CALLIMAGE.log");
       
    32 
       
    33 /*
       
    34  We have 3 possible logging methods:
       
    35 
       
    36  set CALL_LOGGING_METHOD to 0 to get no logging at all
       
    37  set CALL_LOGGING_METHOD to 1 to get logging via RDebug::Print
       
    38  set CALL_LOGGING_METHOD to 2 to get logging to log file
       
    39 
       
    40  Switching on/off is done in the Configuration file (PslnCallImagePluginLoggingConf.h)
       
    41  */
       
    42 
       
    43 #if ( defined (_CALLLOGGING) )
       
    44     #if ( defined (_CALL_LOGGING_TO_FILE))
       
    45         #define CALL_LOGGING_METHOD 2 
       
    46     #else
       
    47         #define CALL_LOGGING_METHOD 1
       
    48     #endif
       
    49 #else
       
    50     #define CALL_LOGGING_METHOD 0
       
    51 #endif
       
    52 
       
    53 
       
    54 #if (CALL_LOGGING_METHOD==0)
       
    55     #define __CALLLOGSTRING(C)
       
    56     #define __CALLLOGSTRING1(C, X)
       
    57     #define __CALLLOGSTRING2(C, X, Y)
       
    58     #define __CALLLOGSTRING3(C, X, Y, Z)
       
    59 #endif
       
    60 #if (CALL_LOGGING_METHOD==1)
       
    61     #define __CALLLOGSTRING(C)            RDebug::Print(_L(C));
       
    62     #define __CALLLOGSTRING1(C, X)        RDebug::Print(_L(C),X);
       
    63     #define __CALLLOGSTRING2(C, X, Y)     RDebug::Print(_L(C),X, Y);
       
    64     #define __CALLLOGSTRING3(C, X, Y, Z)  RDebug::Print(_L(C),X, Y, Z);
       
    65 #endif
       
    66 #if (CALL_LOGGING_METHOD==2)
       
    67     #define __CALLLOGSTRING(C)            {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, tempLogDes());}
       
    68     #define __CALLLOGSTRING1(C, X)        {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, TRefByValue<const TDesC>(tempLogDes()),X);}
       
    69     #define __CALLLOGSTRING2(C, X, Y)     {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, TRefByValue<const TDesC>(tempLogDes()),X,Y);}
       
    70     #define __CALLLOGSTRING3(C, X, Y, Z)  {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, TRefByValue<const TDesC>(tempLogDes()),X,Y,Z);}
       
    71 #endif
       
    72 
       
    73 #endif // PSLNCALLIMAGEPLUGINLOGGER_H