simpleengine/presenceprovisioning/inc/presenceprovlogger.h
changeset 0 c8caa15ef882
equal deleted inserted replaced
-1:000000000000 0:c8caa15ef882
       
     1 /*
       
     2 * Copyright (c) 2006 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:    OMA Presence Provisioning Adapter, for presence settings
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 #ifndef _PRESENCE_PROV_LOGGER_H
       
    23 #define _PRESENCE_PROV_LOGGER_H
       
    24 
       
    25 
       
    26 // logging is done only in debug
       
    27 #ifdef _DEBUG
       
    28 
       
    29 #include <flogger.h>
       
    30 
       
    31 //Logging constants
       
    32 _LIT(KLogDir, "presenceota");
       
    33 _LIT(KLogFile, "presenceprovlog.txt");
       
    34 
       
    35 #define LOG_LIT(s) _L(s)
       
    36 #define LOG_LIT8(s) _L8(s)
       
    37 #define PRES_PROV_LOG DebugWriteFormat
       
    38 
       
    39 
       
    40 /**
       
    41 * Log file printing utility function
       
    42 * @since Series 60 3.0
       
    43 */
       
    44 inline void DebugWriteFormat( TRefByValue<const TDesC> aFmt,...) //lint !e960
       
    45     {
       
    46     VA_LIST list;
       
    47     VA_START (list, aFmt); //lint !e960
       
    48     TBuf< 300 > buffer;
       
    49     buffer.FormatList( aFmt, list );
       
    50     RFileLogger::Write( KLogDir, KLogFile, EFileLoggingModeAppend, buffer );
       
    51     }
       
    52     
       
    53 /**
       
    54 * Log file printing utility function
       
    55 * @since Series 60 3.0
       
    56 */
       
    57 inline void DebugWriteFormat( TRefByValue<const TDesC8> aFmt,...) //lint !e960
       
    58     {
       
    59     VA_LIST list;
       
    60     VA_START (list, aFmt); //lint !e960
       
    61     TBuf8<300> buffer;
       
    62     buffer.FormatList( aFmt, list );
       
    63     RFileLogger::Write( KLogDir, KLogFile, EFileLoggingModeAppend, buffer );
       
    64     }
       
    65     
       
    66 
       
    67 #else // _DEBUG
       
    68 
       
    69 struct LogEmptyDebugString { };
       
    70 
       
    71 #define LOG_LIT(s) LogEmptyDebugString()
       
    72 #define LOG_LIT8(s) LogEmptyDebugString()
       
    73 
       
    74 /// Empty debug print function for release builds.
       
    75 inline void PRES_PROV_LOG(LogEmptyDebugString)
       
    76     {
       
    77     }
       
    78 
       
    79 template<class T1>
       
    80 inline void PRES_PROV_LOG(LogEmptyDebugString,T1)
       
    81     {
       
    82     }
       
    83 
       
    84 template<class T1,class T2>
       
    85 inline void PRES_PROV_LOG(LogEmptyDebugString,T1,T2)
       
    86     {
       
    87     }
       
    88 
       
    89 template<class T1,class T2,class T3>
       
    90 inline void PRES_PROV_LOG(LogEmptyDebugString,T1,T2,T3)
       
    91     {
       
    92     }
       
    93 
       
    94 template<class T1,class T2,class T3,class T4>
       
    95 inline void PRES_PROV_LOG(LogEmptyDebugString,T1,T2,T3,T4)
       
    96     {
       
    97     }
       
    98 
       
    99 template<class T1,class T2,class T3,class T4,class T5>
       
   100 inline void PRES_PROV_LOG(LogEmptyDebugString,T1,T2,T3,T4,T5)
       
   101     {
       
   102     }
       
   103 
       
   104 template<class T1,class T2,class T3,class T4,class T5,class T6>
       
   105 inline void PRES_PROV_LOG(LogEmptyDebugString,T1,T2,T3,T4,T5,T6)
       
   106     {
       
   107     }
       
   108 
       
   109 template<class T1,class T2,class T3,class T4,class T5,class T6,class T7>
       
   110 inline void PRES_PROV_LOG(LogEmptyDebugString,T1,T2,T3,T4,T5,T6,T7)
       
   111     {
       
   112     }
       
   113 
       
   114 template<class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8>
       
   115 inline void PRES_PROV_LOG(LogEmptyDebugString,T1,T2,T3,T4,T5,T6,T7,T8)
       
   116     {
       
   117     }
       
   118 
       
   119 
       
   120 #endif // _DEBUG
       
   121 
       
   122 
       
   123 #endif // _PRESENCE_PROV_LOGGER_H
       
   124             
       
   125 // End of File