cellular/SSSettings/Logger/SSSettingsLogger.h
changeset 0 ff3b6d0fd310
child 19 7d48bed6ce0c
equal deleted inserted replaced
-1:000000000000 0:ff3b6d0fd310
       
     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 SSSETTINGSLOGGER_H
       
    23 #define SSSETTINGSLOGGER_H
       
    24 
       
    25 #include "SSSettingsLoggingConf.h"
       
    26 #include <e32std.h>
       
    27 #include <flogger.h>
       
    28 #include <e32svr.h>
       
    29 
       
    30 _LIT( KLogsDir,                  "SSS");
       
    31 _LIT( KLogFileName,              "SSS.log");
       
    32 
       
    33 /*
       
    34  We have 3 possible logging methods:
       
    35 
       
    36  set SSS_LOGGING_METHOD to 0 to get no logging at all
       
    37  set SSS_LOGGING_METHOD to 1 to get logging via RDebug::Print
       
    38  set SSS_LOGGING_METHOD to 2 to get logging to log file
       
    39 
       
    40  Switching on/off is done in the Configuration file (SSSettingsLoggingConf.h)
       
    41  */
       
    42 
       
    43 #if ( defined (_SSSLOGGING) )
       
    44     #if ( defined (_SSS_LOGGING_TO_FILE))
       
    45         #define SSS_LOGGING_METHOD 2 
       
    46     #else
       
    47         #define SSS_LOGGING_METHOD 1
       
    48     #endif
       
    49 #else
       
    50     #define SSS_LOGGING_METHOD 0
       
    51 #endif
       
    52 
       
    53 
       
    54 #if (SSS_LOGGING_METHOD==0)
       
    55     #define __SSSLOGSTRING(C)
       
    56     #define __SSSLOGSTRING1(C, X)
       
    57     #define __SSSLOGSTRING2(C, X, Y)
       
    58     #define __SSSLOGSTRING3(C, X, Y, Z)
       
    59 #endif
       
    60 #if (SSS_LOGGING_METHOD==1)
       
    61     #define __SSSLOGSTRING(C)            RDebug::Print(_L(C));
       
    62     #define __SSSLOGSTRING1(C, X)        RDebug::Print(_L(C),X);
       
    63     #define __SSSLOGSTRING2(C, X, Y)     RDebug::Print(_L(C),X, Y);
       
    64     #define __SSSLOGSTRING3(C, X, Y, Z)  RDebug::Print(_L(C),X, Y, Z);
       
    65 #endif
       
    66 #if (SSS_LOGGING_METHOD==2)
       
    67     #define __SSSLOGSTRING(C)            {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, tempLogDes());}
       
    68     #define __SSSLOGSTRING1(C, X)        {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, TRefByValue<const TDesC>(tempLogDes()),X);}
       
    69     #define __SSSLOGSTRING2(C, X, Y)     {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, TRefByValue<const TDesC>(tempLogDes()),X,Y);}
       
    70     #define __SSSLOGSTRING3(C, X, Y, Z)  {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, TRefByValue<const TDesC>(tempLogDes()),X,Y,Z);}
       
    71 #endif
       
    72 
       
    73 #endif // SSSETTINGSLOGGER_H