equal
deleted
inserted
replaced
1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
24 /** |
24 /** |
25 @internalComponent |
25 @internalComponent |
26 */ |
26 */ |
27 const TInt KOpenLogFilesGranularity=5; |
27 const TInt KOpenLogFilesGranularity=5; |
28 |
28 |
|
29 /* Internal error. Use positive number to ensure no conflict with other error code |
|
30 Indicate that client message has panic'ed and should not be completed. |
|
31 */ |
|
32 const TInt KErrMessagePanic = 1; |
|
33 |
29 /** |
34 /** |
30 panics for log client |
35 panics for log client |
31 |
36 |
32 @internalComponent |
37 @internalComponent |
33 */ |
38 */ |
266 @internalTechnology |
271 @internalTechnology |
267 */ |
272 */ |
268 { |
273 { |
269 |
274 |
270 TRAPD(ret,DispatchMessageL(aMessage)); |
275 TRAPD(ret,DispatchMessageL(aMessage)); |
271 aMessage.Complete(ret); |
276 if (ret!=KErrMessagePanic) |
|
277 { |
|
278 aMessage.Complete(ret); |
|
279 } |
272 } |
280 } |
273 |
281 |
274 void CFileLogSession::DispatchMessageL(const RMessage2& aMessage) |
282 void CFileLogSession::DispatchMessageL(const RMessage2& aMessage) |
275 { |
283 { |
276 |
284 |
279 User::Leave(KErrNotSupported); |
287 User::Leave(KErrNotSupported); |
280 |
288 |
281 TLogFile log; |
289 TLogFile log; |
282 TPckg<TLogFile> logPckg(log); |
290 TPckg<TLogFile> logPckg(log); |
283 aMessage.ReadL(0,logPckg); |
291 aMessage.ReadL(0,logPckg); |
284 __ASSERT_ALWAYS(log.Directory().Length()!=0,aMessage.Panic(KFLoggerServerName,ELogDirectoryNameDoesNotExist)); |
292 if (log.Directory().Length()<=0) |
285 __ASSERT_ALWAYS(log.Name().Length()!=0,aMessage.Panic(KFLoggerServerName,ELogFileNameDoesNotExist)); |
293 { |
|
294 aMessage.Panic(KFLoggerServerName,ELogDirectoryNameDoesNotExist); |
|
295 User::Leave(KErrMessagePanic); |
|
296 } |
|
297 |
|
298 if (log.Name().Length()<=0) |
|
299 { |
|
300 aMessage.Panic(KFLoggerServerName,ELogFileNameDoesNotExist); |
|
301 User::Leave(KErrMessagePanic); |
|
302 } |
286 |
303 |
287 // TBuf8<KLogBufferSize> buf; |
304 // TBuf8<KLogBufferSize> buf; |
288 TBuf8<1600> buf; |
305 TBuf8<1600> buf; |
289 if (func==EWriteLog || func==ECreateWriteAndCloseLog) |
306 if (func==EWriteLog || func==ECreateWriteAndCloseLog) |
|
307 { |
290 aMessage.ReadL(1,buf); |
308 aMessage.ReadL(1,buf); |
|
309 } |
291 |
310 |
292 switch (func) |
311 switch (func) |
293 { |
312 { |
294 case ECreateLog: |
313 case ECreateLog: |
295 OpenLogL(log); |
314 OpenLogL(log); |