Update contrib.
1 // Copyright (c) 1997-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.
31 const TUint KFLoggerStackSize=0x3000;
34 min heap size for file logger
38 const TUint KFLoggerMinHeapSize=0x1000;
41 define _FLOGGER_LARGE_HEAP if flogger is
42 running out of memory (KErrNoMemory)
44 #ifdef _FLOGGER_LARGE_HEAP
47 Max heap size for file logger
51 const TUint KFLoggerMaxHeapSize=0x100000; /// 1M
56 Max heap size for file logger
60 const TUint KFLoggerMaxHeapSize=0x40000; /// 256K
62 #endif // _FLOGGER_LARGE_HEAP
66 Uid for the Flogger server
70 const TInt KFLoggerServerUid=0x10004ee0;
73 Literal which contains FLOGSVR
77 _LIT(KFLoggerServerExecutable,"FLOGSVR");
80 FLogger class definition
85 Start the FLOGGER server.
87 @return KErrNone if successful
93 TInt ret=server.Create(KFLoggerServerExecutable,KNullDesC,TUidType(KNullUid,KNullUid,TUid::Uid(KFLoggerServerUid)),EOwnerThread);
96 server.Rendezvous(stat);
99 User::WaitForRequest(stat);
103 EXPORT_C TInt FLogger::Run(FLogger::TSignal& /*aSignal*/)
105 Instantiates Active scheduler for the asynchronous request.
107 @param aSignal signal info
108 @return KErrNone if successful else KErrNoMemory
115 CTrapCleanup* cleanup=CTrapCleanup::New();
122 RProcess::Rendezvous(ret);
124 CActiveScheduler::Start();
126 delete CActiveScheduler::Current();
136 Initialises CFLoggerScheduler
138 @return KErrNone if successful
142 TRAPD(ret,CFLoggerScheduler::NewL());
147 CFLoggerScheduler class definitions
150 void CFLoggerScheduler::NewL()
152 Installs CActiveScheduler
157 // ensure the server thread has a handle on FLOGGER.DLL
158 _LIT(KFLoggerLibraryName,"FLOGGER");
160 User::LeaveIfError(l.Load(KFLoggerLibraryName,KNullDesC));
163 User::LeaveIfError(RThread::RenameMe(KFLoggerServerName));
165 CFLoggerScheduler* self=new(ELeave) CFLoggerScheduler;
166 CActiveScheduler::Install(self);
167 self->iServer=CFileLoggerServer::NewL();
170 CFLoggerScheduler::~CFLoggerScheduler()
179 void CFLoggerScheduler::Error(TInt aError) const
181 Message servicing failed
183 @param aError error value for failed message
186 iServer->Error(aError);