|
1 // Copyright (c) 2002-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 #include <e32uid.h> |
|
17 |
|
18 #ifndef NO_LOG_ENGINE_IN_ROM |
|
19 #include <logcli.h> |
|
20 #endif |
|
21 |
|
22 #include <logwrap.h> |
|
23 #include "LOGPANIC.H" |
|
24 |
|
25 EXPORT_C CLogWrapper::~CLogWrapper() |
|
26 /** Frees all resources owned by the log wrapper prior to its destruction. Specifically, |
|
27 it deletes the Log Engine (or the instance of the Log Engine base class, if |
|
28 the UI variant does not have a Log Engine installed). */ |
|
29 { |
|
30 delete iBase; |
|
31 } |
|
32 |
|
33 EXPORT_C CLogWrapper* CLogWrapper::NewL(RFs& aFs, TInt aPriority/* = CActive::EPriorityStandard*/) |
|
34 { |
|
35 CLogWrapper* self = new(ELeave)CLogWrapper(); |
|
36 CleanupStack::PushL(self); |
|
37 self->ConstructL(aFs, aPriority); |
|
38 CleanupStack::Pop(); // self |
|
39 return self; |
|
40 } |
|
41 |
|
42 CLogWrapper::CLogWrapper() |
|
43 { |
|
44 } |
|
45 |
|
46 #ifndef NO_LOG_ENGINE_IN_ROM |
|
47 void CLogWrapper::ConstructL(RFs& aFs, TInt aPriority) |
|
48 { |
|
49 iBase = CLogClient::NewL(aFs, aPriority); |
|
50 } |
|
51 #else |
|
52 #pragma BullseyeCoverage off |
|
53 void CLogWrapper::ConstructL(RFs&, TInt aPriority) |
|
54 { |
|
55 iBase = new(ELeave)CLogBase(aPriority); |
|
56 } |
|
57 #pragma BullseyeCoverage on |
|
58 #endif |
|
59 |
|
60 EXPORT_C TBool CLogWrapper::ClientAvailable() const |
|
61 /** Determines whether the Log Engine is installed. |
|
62 |
|
63 @return ETrue if there is a Log Engine, EFalse, otherwise. */ |
|
64 { |
|
65 #ifndef NO_LOG_ENGINE_IN_ROM |
|
66 return ETrue; |
|
67 #else |
|
68 return EFalse; |
|
69 #endif |
|
70 } |