contextengine/plugins/calendarplugin/inc/CalendarContextLogger.h
changeset 0 c53acadfccc6
equal deleted inserted replaced
-1:000000000000 0:c53acadfccc6
       
     1 /*
       
     2 * Copyright (c) 2002-2009 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:  Logging support for R&D purposes
       
    15 *
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef CALENDARCONTEXTLOGGER_H_INCLUDED
       
    21 #define CALENDARCONTEXTLOGGER_H_INCLUDED
       
    22 
       
    23 // ========== INCLUDE FILES ================================
       
    24 
       
    25 #include <eikenv.h>
       
    26 
       
    27 // ========== CONSTANTS ====================================
       
    28 
       
    29 #ifdef CALCON_LOGGING_ON
       
    30 
       
    31 _LIT( KLBENGLogDir,               "CALCON");
       
    32 _LIT( KLBENGLogFile,              "CALCON.txt");
       
    33 _LIT( KLBENGLogBanner,            "CALCON 0.1.0");
       
    34 _LIT( KLBENGLogEnterFn,           "CALCON: -> %S");
       
    35 _LIT( KLBENGLogLeaveFn,           "CALCON: <- %S");
       
    36 _LIT( KLBENGLogExit,              "CALCON: Application exit");
       
    37 _LIT( KLBENGLogTimeFormatString,  "%H:%T:%S:%*C2");
       
    38 
       
    39 // ========== MACROS =======================================
       
    40 
       
    41 #define CALCONLOGGER_CREATE
       
    42 #define CALCONLOGGER_DELETE
       
    43 #define CALCONLOGGER_ENTERFN(a)         {_LIT(temp, a); RDebug::Print( KLBENGLogEnterFn, &temp);}
       
    44 #define CALCONLOGGER_LEAVEFN(a)         {_LIT(temp, a); RDebug::Print( KLBENGLogLeaveFn, &temp);}
       
    45 #define CALCONLOGGER_WRITE(a)           {_LIT(temp, a); RDebug::Print( temp);}
       
    46 #define CALCONLOGGER_WRITE_TIMESTAMP(a) {_LIT(temp, a); TTime time; time.HomeTime(); TBuf<256> buffer; time.FormatL( buffer, KLBENGLogTimeFormatString ); buffer.Insert(0, temp); RDebug::Print( buffer); }
       
    47 #define CALCONLOGGER_WRITEF             RDebug::Print
       
    48 
       
    49 /**
       
    50  * 
       
    51  */
       
    52 inline void FPrint( const TRefByValue<const TDesC> aFmt, ... );
       
    53 
       
    54 /**
       
    55  * 
       
    56  */
       
    57 inline void FPrint( const TDesC& aDes );
       
    58 
       
    59 /**
       
    60  * 
       
    61  */
       
    62 inline void FHex( const TUint8* aPtr, TInt aLen );
       
    63 
       
    64 /**
       
    65  * 
       
    66  */
       
    67 inline void FHex( const TDesC8& aDes );
       
    68 
       
    69 /**
       
    70  * 
       
    71  */
       
    72 inline void FCreate();
       
    73 
       
    74 #include "CalendarContextLogger.inl"
       
    75 
       
    76 
       
    77 #else // CALCON_LOGGING_ON
       
    78 
       
    79 inline void FPrint( const TRefByValue<const TDesC> /*aFmt*/, ... ) { };
       
    80 
       
    81 #define CALCONLOGGER_CREATE
       
    82 #define CALCONLOGGER_DELETE
       
    83 #define CALCONLOGGER_ENTERFN(a)
       
    84 #define CALCONLOGGER_LEAVEFN(a)
       
    85 #define CALCONLOGGER_WRITE(a)
       
    86 #define CALCONLOGGER_WRITEF   1 ? ((void)0) : FPrint
       
    87 #define CALCONLOGGER_WRITE_TIMESTAMP(a)
       
    88 
       
    89 #endif // CALCON_LOGGING_ON
       
    90 
       
    91 // ========== DATA TYPES ===================================
       
    92 
       
    93 // ========== FUNCTION PROTOTYPES ==========================
       
    94 
       
    95 // ========== FORWARD DECLARATIONS =========================
       
    96 
       
    97 // ========== CLASS DECLARATION ============================
       
    98 
       
    99 #endif // CALENDARCONTEXTLOGGER_H_INCLUDED