vpnengine/kmdserver/inc/kmddebuglogger.h
changeset 0 33413c0669b9
equal deleted inserted replaced
-1:000000000000 0:33413c0669b9
       
     1 /*
       
     2 * Copyright (c) 2008-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:  Write logs in debug builds
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_KMDDEBUGLOGGER_H
       
    20 #define C_KMDDEBUGLOGGER_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <flogger.h>
       
    24 
       
    25 #include "ikedebug.h"
       
    26 
       
    27 /**
       
    28  *  KMD debug logger.
       
    29  *  Logger for writing logs in debug builds.
       
    30  *  @lib internal (kmdserver.exe)
       
    31  */
       
    32 class CKmdDebugLogger : public CBase,
       
    33                         public MIkeDebug
       
    34     {
       
    35 public:
       
    36 
       
    37     /**
       
    38      * Two-phased constructor.
       
    39      */    
       
    40     static CKmdDebugLogger* NewL();
       
    41     
       
    42     /**
       
    43     * Destructor.
       
    44     */    
       
    45     ~CKmdDebugLogger();
       
    46 
       
    47 #ifdef _DEBUG
       
    48 
       
    49     void LogWrite( const TDesC& aText );
       
    50     void LogWrite( const TDesC8& aText );
       
    51     
       
    52     void LogWriteF( TRefByValue<const TDesC> aFmt, ... );
       
    53     void LogWriteF( TRefByValue<const TDesC8> aFmt, ... );
       
    54     
       
    55     void LogWriteArray( const TUint8* aArray, TInt aLength );
       
    56     
       
    57     void LogWriteNum( TUint aNum );
       
    58     
       
    59     void TraceMessage( const TDesC8& aMessage, 
       
    60                        const TInetAddr& aSourceAddress, 
       
    61                        const TInetAddr& aDestinationAddress,
       
    62                        CIkePcapTrace::TEncryptionType aEncryptionType );
       
    63    
       
    64 private:
       
    65     void ConstructL();
       
    66         
       
    67     /**
       
    68      * File logger.
       
    69      * Own.
       
    70      */
       
    71     RFileLogger     iFileLogger;
       
    72 
       
    73     /**
       
    74      * PCap tracer.
       
    75      * Own.
       
    76      */
       
    77     CIkePcapTrace*  iIkePcapTrace;
       
    78     
       
    79 #endif // _DEBUG    
       
    80     };
       
    81 
       
    82 #endif // C_KMDDEBUGLOGGER_H