diff -r 000000000000 -r af10295192d8 networkprotocols/dnsproxy/dnsproxyserver/src/dnsproxylog.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/networkprotocols/dnsproxy/dnsproxyserver/src/dnsproxylog.cpp Tue Jan 26 15:23:49 2010 +0200 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include "dnsproxylog.h" + +#include +#include + +const TInt KMaxLogData = 255; + +#ifdef DNSPROXY_LOGGING_METHOD_RDEBUG +void DNSProxyLog::LogRaw(const TDesC&, TDes& aData) +#else +void DNSProxyLog::LogRaw(const TDesC& aLogfile, TDes& aData) +#endif + { + #ifdef DNSPROXY_LOGGING_METHOD_RDEBUG + //RFileLogger::Write(KLogDirectory, aLogfile, EFileLoggingModeAppend, aData); + RDebug::Print( _L("%S"), &aData ); + #endif + + #if defined( DNSPROXY_LOGGING_METHOD_FLOGGER ) + RFileLogger::Write(KLogDirectory, aLogfile, EFileLoggingModeAppend, aData); + #endif + } + +void DNSProxyLog::LogFmt(const TDesC& aLogfile, TRefByValue aFmt,...) + { + VA_LIST list; + VA_START(list,aFmt); + + TBuf buf; + buf.FormatList(aFmt,list); + + DNSProxyLog::LogRaw(aLogfile, buf ); + }