datacommsserver/esockserver/csock/CS_LOG.CPP
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @internalComponent
       
    19 */
       
    20 
       
    21 
       
    22 #include <e32std.h>
       
    23 #include "es_flog.h"
       
    24 #include <comms-infras/commsdebugutility.h>
       
    25 
       
    26 #if defined (__FLOG_ACTIVE)
       
    27 
       
    28 /**
       
    29 @internalComponent
       
    30 */
       
    31 _LIT(KESockLogFolder, "esock");
       
    32 
       
    33 /**
       
    34 @internalComponent
       
    35 */
       
    36 _LIT(KESockLogFile, "esock.txt");
       
    37 
       
    38 void ESockLogExternal::Printf(const TDesC8& /*aComponent*/, const TDesC8& /*aSubTag*/, TRefByValue<const TDesC8> aFmt, VA_LIST& aList)
       
    39 /**
       
    40 Write a multiple argument list to the log, trapping and ignoring any leave
       
    41 
       
    42 */
       
    43 	{
       
    44 	
       
    45 	// Format the text.
       
    46 	TBuf8<200> buf8;
       
    47 	buf8.FormatList(aFmt, aList);
       
    48 	
       
    49 	// Convert it to Unicode.
       
    50 	TBuf16<200> buf16;
       
    51 	buf16.Copy(buf8);
       
    52 	
       
    53 	RFileLogger::WriteFormat(KESockLogFolder, KESockLogFile, EFileLoggingModeAppend, buf16);
       
    54 	}
       
    55 
       
    56 void ESockLog::Printf(TRefByValue<const TDesC> aFmt,...)
       
    57 /**
       
    58 Write a multiple argument list to the log, trapping and ignoring any leave
       
    59 
       
    60 */
       
    61 	{
       
    62 
       
    63 	VA_LIST list;
       
    64 	VA_START(list,aFmt);
       
    65 	RFileLogger::WriteFormat(KESockLogFolder(), KESockLogFile(), EFileLoggingModeAppend, aFmt, list);
       
    66 	}
       
    67 
       
    68 void ESockLog::Printf(TRefByValue<const TDesC8> aFmt,...)
       
    69 /**
       
    70 Write a multiple argument list to the log, trapping and ignoring any leave
       
    71 
       
    72 */
       
    73 	{
       
    74 
       
    75 	VA_LIST list;
       
    76 	VA_START(list,aFmt);
       
    77 	RFileLogger::WriteFormat(KESockLogFolder(), KESockLogFile(), EFileLoggingModeAppend, aFmt, list);
       
    78 	}
       
    79 
       
    80 #endif