hti/HtiCommPlugins/HtiBtCommPlugin/HtiBtCommServer/inc/Logger.h
branchRCL_3
changeset 59 8ad140f3dd41
parent 0 a03f92240627
equal deleted inserted replaced
49:7fdc9a71d314 59:8ad140f3dd41
       
     1 /*
       
     2 * Copyright (c) 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:  Logger library
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __LOGGER_H_____
       
    20 #define __LOGGER_H_____
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32std.h>
       
    24 
       
    25 // CONSTANTS
       
    26 const TInt KLogLevelDebug   = 0;
       
    27 const TInt KLogLevelInfo    = 10;
       
    28 const TInt KLogLevelWarning = 20;
       
    29 const TInt KLogLevelError   = 30;
       
    30 
       
    31 const TInt KMinimumLogLevel = KLogLevelInfo;
       
    32 
       
    33 
       
    34 // When __ENABLE_LOGGING__ macro is defined, logging functions are
       
    35 // compiled to final build.
       
    36 //
       
    37 // Example usage: LOGFW(DebugLog(_L("Got an error %d"), 5))
       
    38 //
       
    39 #ifdef __ENABLE_LOGGING__
       
    40 
       
    41     #define LOGFW(a) a;
       
    42 
       
    43     _LIT(KLogFileName, "c:\\HTI_BtComm.log");
       
    44 
       
    45     // panics
       
    46     _LIT(KLogPanicCategory, "CustNotifyLog");
       
    47     static const TInt KPanicFsConnectFailed = 1;
       
    48     static const TInt KPanicFileCreateFailed = 2;
       
    49     static const TInt KPanicFileWriteFailed = 3;
       
    50 
       
    51     const TInt KLogEntryMaxLength = 156;
       
    52 
       
    53     // Usage example: DOLOG(_L("Logstring"));
       
    54     void DebugLog(TRefByValue<const TDesC> aFmt,...);
       
    55     void InfoLog(TRefByValue<const TDesC> aFmt,...);
       
    56     void WarnLog(TRefByValue<const TDesC> aFmt,...);
       
    57     void ErrLog(TRefByValue<const TDesC> aFmt,...);
       
    58 
       
    59     void Log(TInt aLevel, TRefByValue<const TDesC> aFmt, VA_LIST list);
       
    60 
       
    61     void LogBytes(const TDesC8& aData, TInt aMaxBytesToLog );
       
    62 
       
    63 #else  //__ENABLE_LOGGING__
       
    64 
       
    65     #define LOGFW(a)
       
    66 
       
    67 #endif //__ENABLE_LOGGING__
       
    68 
       
    69 #endif //__LOGGER_H_____
       
    70