pushmtm/Plugins/WhiteListAdapterSrc/WhiteListAdapterLogger.cpp
changeset 51 48e827313edd
parent 37 481242ead638
child 53 f427d27b98d8
equal deleted inserted replaced
37:481242ead638 51:48e827313edd
     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 the License "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 *      Implementation of class WhiteListAdapterLogger.   
       
    16 *      
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 #ifdef __TEST_WHITELISTADAPTER_LOG__
       
    22 
       
    23 // INCLUDE FILES
       
    24     // System includes
       
    25 #include <flogger.h>
       
    26 
       
    27     // User includes
       
    28 #include "WhiteListAdapterLogger.h"
       
    29 
       
    30 // ================= CONSTANTS =======================
       
    31 
       
    32 /// White List Adapter logging directory.
       
    33 _LIT( KWhiteListAdapterLogDir, "WLA" );
       
    34 /// White List Adapter log file name.
       
    35 _LIT( KWhiteListAdapterLogFile, "Log.txt" );
       
    36 
       
    37 // ================= MEMBER FUNCTIONS =======================
       
    38 
       
    39 // ---------------------------------------------------------
       
    40 // WhiteListAdapterLogger::Write()
       
    41 // ---------------------------------------------------------
       
    42 //
       
    43 void WhiteListAdapterLogger::Write
       
    44 ( TInt32 aMask, TInt aLevel, TRefByValue<const TDesC16> aFmt, ... )
       
    45     {
       
    46     if( ( aMask & WHITELISTADAPTER_LOG_MASK ) &&
       
    47         ( aLevel <= WHITELISTADAPTER_LOG_LEVEL ) )
       
    48         {
       
    49         VA_LIST list;
       
    50         VA_START( list, aFmt );
       
    51         RFileLogger::WriteFormat
       
    52             (
       
    53             KWhiteListAdapterLogDir,
       
    54             KWhiteListAdapterLogFile,
       
    55             EFileLoggingModeAppend,
       
    56             aFmt,
       
    57             list
       
    58             );
       
    59         VA_END( list );
       
    60         }
       
    61     }
       
    62 
       
    63 // ---------------------------------------------------------
       
    64 // WhiteListAdapterLogger::Write()
       
    65 // ---------------------------------------------------------
       
    66 //
       
    67 void WhiteListAdapterLogger::Write
       
    68 ( TInt32 aMask, TInt aLevel, TRefByValue<const TDesC16> aFmt, VA_LIST& aList )
       
    69     {
       
    70     if( ( aMask & WHITELISTADAPTER_LOG_MASK ) &&
       
    71         ( aLevel <= WHITELISTADAPTER_LOG_LEVEL ) )
       
    72         {
       
    73         RFileLogger::WriteFormat
       
    74             (
       
    75             KWhiteListAdapterLogDir,
       
    76             KWhiteListAdapterLogFile,
       
    77             EFileLoggingModeAppend,
       
    78             aFmt,
       
    79             aList
       
    80             );
       
    81         }
       
    82     }
       
    83 
       
    84 // ---------------------------------------------------------
       
    85 // WhiteListAdapterLogger::Write()
       
    86 // ---------------------------------------------------------
       
    87 //
       
    88 void WhiteListAdapterLogger::Write
       
    89 ( TInt32 aMask, TInt aLevel, TRefByValue<const TDesC8> aFmt, ... )
       
    90     {
       
    91     if( ( aMask & WHITELISTADAPTER_LOG_MASK ) &&
       
    92         ( aLevel <= WHITELISTADAPTER_LOG_LEVEL ) )
       
    93         {
       
    94         VA_LIST list;
       
    95         VA_START( list, aFmt );
       
    96         RFileLogger::WriteFormat
       
    97             (
       
    98             KWhiteListAdapterLogDir,
       
    99             KWhiteListAdapterLogFile,
       
   100             EFileLoggingModeAppend,
       
   101             aFmt,
       
   102             list
       
   103             );
       
   104         VA_END( list );
       
   105         }
       
   106     }
       
   107 
       
   108 // ---------------------------------------------------------
       
   109 // WhiteListAdapterLogger::Write()
       
   110 // ---------------------------------------------------------
       
   111 //
       
   112 void WhiteListAdapterLogger::Write
       
   113 ( TInt32 aMask, TInt aLevel, TRefByValue<const TDesC8> aFmt, VA_LIST& aList )
       
   114     {
       
   115     if( ( aMask & WHITELISTADAPTER_LOG_MASK ) &&
       
   116         ( aLevel <= WHITELISTADAPTER_LOG_LEVEL ) )
       
   117         {
       
   118         RFileLogger::WriteFormat
       
   119             (
       
   120             KWhiteListAdapterLogDir,
       
   121             KWhiteListAdapterLogFile,
       
   122             EFileLoggingModeAppend,
       
   123             aFmt,
       
   124             aList
       
   125             );
       
   126         }
       
   127     }
       
   128 
       
   129 // ---------------------------------------------------------
       
   130 // WhiteListAdapterLogger::HexDump()
       
   131 // ---------------------------------------------------------
       
   132 //
       
   133 void WhiteListAdapterLogger::HexDump
       
   134         (
       
   135         TInt32 aMask,
       
   136         TInt aLevel, 
       
   137         const TText* aHeader,
       
   138         const TText* aMargin,
       
   139         const TUint8* aPtr,
       
   140         TInt aLen
       
   141         )
       
   142     {
       
   143     if( ( aMask & WHITELISTADAPTER_LOG_MASK ) &&
       
   144         ( aLevel <= WHITELISTADAPTER_LOG_LEVEL ) )
       
   145         {
       
   146         RFileLogger::HexDump
       
   147             (
       
   148             KWhiteListAdapterLogDir,
       
   149             KWhiteListAdapterLogFile,
       
   150             EFileLoggingModeAppend,
       
   151             aHeader,
       
   152             aMargin,
       
   153             aPtr,
       
   154             aLen
       
   155             );
       
   156         }
       
   157     }
       
   158 
       
   159 #endif // __TEST_WHITELISTADAPTER_LOG__