mobilemessaging/smum/inc/SmumLogging.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 /*
       
     2 * Copyright (c) 2002 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 *     Logging defines for Mce application
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #if !defined(__SMUMLOGGING_H__)
       
    22 #define __SMUMLOGGING_H__
       
    23 
       
    24 #include <flogger.h>
       
    25 
       
    26 //
       
    27 #ifdef USE_LOGGER
       
    28 //
       
    29 #ifdef USE_RDEBUG
       
    30 // SMUM RDEbug Logging
       
    31     _LIT(KSmumLogEnterFn,          	"SMUM: -> %S");
       
    32     _LIT(KSmumLogLeaveFn,          	"SMUM: <- %S");
       
    33     _LIT(KSmumLogWrite,            	"SMUM: %S");
       
    34     _LIT(KSmumLogTimeFormatString,	"%H:%T:%S:%*C2");
       
    35 #define SMUMLOGGER_ENTERFN(a)        {_LIT(temp, a); RDebug::Print(KSmumLogEnterFn, &temp);}
       
    36 #define SMUMLOGGER_LEAVEFN(a)        {_LIT(temp, a); RDebug::Print(KSmumLogLeaveFn, &temp);} 
       
    37 #define SMUMLOGGER_WRITE(a)          {_LIT(temp, a); RDebug::Print(KSmumLogWrite, &temp);}
       
    38 #define SMUMLOGGER_WRITE_FORMAT(a,b) {_LIT(temp, a); TBuf<256> buf; buf.Format(temp, b); RDebug::Print(buf);}
       
    39 #define SMUMLOGGER_WRITE_TIMESTAMP(a) {_LIT(temp, a); TTime time; time.HomeTime(); TBuf<256> buffer; time.FormatL( buffer, KSmumLogTimeFormatString ); buffer.Insert(0, temp); RDebug::Print(buffer); }
       
    40 
       
    41 #else
       
    42 //Use RFileLogger
       
    43     _LIT(KSmumLogDir,               "Sms");
       
    44     _LIT(KSmumLogFile,              "Smum.txt");
       
    45     _LIT8(KSmumLogEnterFn,          "-> %S");
       
    46     _LIT8(KSmumLogLeaveFn,          "<- %S");
       
    47     _LIT( KSmumLogTimeFormatString, "%H:%T:%S:%*C2");
       
    48 #define SMUMLOGGER_ENTERFN(a)        {_LIT8(temp, a); RFileLogger::WriteFormat(KSmumLogDir, KSmumLogFile, EFileLoggingModeAppend, KSmumLogEnterFn, &temp);}
       
    49 #define SMUMLOGGER_LEAVEFN(a)        {_LIT8(temp, a); RFileLogger::WriteFormat(KSmumLogDir, KSmumLogFile, EFileLoggingModeAppend, KSmumLogLeaveFn, &temp);}
       
    50 #define SMUMLOGGER_WRITE(a)          {_LIT(temp, a); RFileLogger::Write(KSmumLogDir, KSmumLogFile, EFileLoggingModeAppend, temp);}
       
    51 #define SMUMLOGGER_WRITE_FORMAT(a,b) {_LIT(temp, a); RFileLogger::WriteFormat(KSmumLogDir, KSmumLogFile, EFileLoggingModeAppend, temp, b);}
       
    52 #define SMUMLOGGER_WRITE_TIMESTAMP(a) {_LIT(temp, a); TTime time; time.HomeTime(); TBuf<256> buffer; time.FormatL( buffer, KMceLogTimeFormatString ); buffer.Insert(0, temp); RFileLogger::Write(KSmumLogDir, KSmumLogFile, EFileLoggingModeAppend, buffer); }
       
    53 
       
    54 #endif //USE_RDEBUG
       
    55 #else // no logger
       
    56 
       
    57 #define SMUMLOGGER_ENTERFN(a)
       
    58 #define SMUMLOGGER_LEAVEFN(a)
       
    59 #define SMUMLOGGER_WRITE(a)
       
    60 #define SMUMLOGGER_WRITE_FORMAT(a, b)
       
    61 #define SMUMLOGGER_WRITE_TIMESTAMP(a)
       
    62 
       
    63 #endif // USE_LOGGER
       
    64 #endif // __SMUMLOGGING_H__
       
    65 
       
    66     // End of File