Update contrib.
1 // Copyright (c) 2003-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // code that logs using RDebug::Print
21 EXPORT_C CDebugLogBase *CreateDebugLog(TBool aIsFirst, TDesC &aParams)
23 CDebugLogPrint *device=new(ELeave) CDebugLogPrint();
25 TRAPD(err,log=new(ELeave) CDebugLog(device));
31 TRAP(err,log->ConstructL(aIsFirst, aParams));
40 CDebugLogPrint::CDebugLogPrint()
43 CDebugLogPrint::~CDebugLogPrint()
46 void CDebugLogPrint::ConstructL(TBool /*aIsFirst*/, TDesC& /*aParams*/)
49 void CDebugLogPrint::WriteToLogL(const TDesC &aDes, const TDesC &aDes2)
52 TInt pos=aDes.LocateReverse(' ');
55 buf.Copy(aDes.Mid(pos));
58 _LIT(KDebugFormatString, "%S");
59 RDebug::Print(KDebugFormatString, &buf);
62 void CDebugLogPrint::WriteToLog8L(const TDesC8 &aDes, const TDesC8 &aDes2)
65 TInt pos=aDes.LocateReverse(' ');
68 buf.Copy(aDes.Mid(pos));
70 TInt bufLen=buf.Length();
71 TPtr16 ptr(&buf[bufLen],buf.MaxLength()-bufLen);
73 buf.SetLength(bufLen+aDes2.Length());
74 _LIT(KDebugFormatString, "%S");
75 RDebug::Print(KDebugFormatString, &buf);