|
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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Implements the Flogger server side message processing |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @internalComponent |
|
21 */ |
|
22 |
|
23 #include "comsdbgmessages.h" |
|
24 #include "comsdbgwriter.h" |
|
25 #include "comsdbgaux.h" |
|
26 |
|
27 void CTimeUpdateMessage::Invoke(MLogMessageProtocol& aProtocol) |
|
28 { |
|
29 TRAP_IGNORE(aProtocol.SetTimeL(iTime)); |
|
30 //Ignore error. Worst case would mean time doesn't make it into log. |
|
31 } |
|
32 |
|
33 CTimeUpdateMessage::CTimeUpdateMessage(const TTime& aTime) |
|
34 : iTime(aTime) |
|
35 {} |
|
36 |
|
37 ///////////////////////////////////////////////////////////////////////// |
|
38 |
|
39 void CMediaUpdateMessage::Invoke(MLogMessageProtocol& aProtocol) |
|
40 { |
|
41 aProtocol.MediaUpdate(iLogMediaSetting,iForceFlushSetting, iLogPathSetting); |
|
42 } |
|
43 |
|
44 CMediaUpdateMessage::CMediaUpdateMessage(MIniLoggingMediaQuery& aQuery) |
|
45 { |
|
46 aQuery.LogMediaSetting(iLogMediaSetting); |
|
47 // if force flush value not yet known, false will be returned. |
|
48 aQuery.FlushingOn(iForceFlushSetting); |
|
49 aQuery.LogPathSetting(iLogPathSetting); |
|
50 } |
|
51 |
|
52 //////////////////////////////////////////////////////////////////////// |
|
53 |
|
54 CClearLogMessage::CClearLogMessage(const TFullName& aName) |
|
55 : iThreadName(aName) |
|
56 {} |
|
57 |
|
58 void CClearLogMessage::Invoke(MLogMessageProtocol& aProtocol) |
|
59 { |
|
60 aProtocol.ClearLog(iThreadName); |
|
61 } |
|
62 |
|
63 //////////////////////////////////////////////////////////////////////// |
|
64 |
|
65 void CLogStringMessage::Invoke(MLogMessageProtocol& aProtocol) |
|
66 { |
|
67 aProtocol.LogString(*iLogString, iSubsystem, iComponent, iThreadId); |
|
68 } |
|
69 |
|
70 CLogStringMessage::CLogStringMessage(HBufC8* aString, const TDesC8& aSubSystem, const TDesC8& aComponent, const TThreadId& aThreadId) |
|
71 : iLogString(aString), iSubsystem(aSubSystem), iComponent(aComponent), iThreadId(aThreadId) |
|
72 {} |
|
73 |
|
74 CLogStringMessage::~CLogStringMessage() |
|
75 { |
|
76 delete iLogString; |
|
77 } |
|
78 |
|
79 /////////////////////////////////////////////////////////////////////// |
|
80 |
|
81 void CLogBinaryString::Invoke(MLogMessageProtocol& aProtocol) |
|
82 { |
|
83 aProtocol.LogBinaryDump(*iBinaryString, iSubsystem, iComponent); |
|
84 } |
|
85 |
|
86 CLogBinaryString::CLogBinaryString(HBufC8* aBinaryString, const TDesC8& aSubSystem, const TDesC8& aComponent) |
|
87 : iBinaryString(aBinaryString), iSubsystem(aSubSystem), iComponent(aComponent) |
|
88 {} |
|
89 |
|
90 CLogBinaryString::~CLogBinaryString() |
|
91 { |
|
92 delete iBinaryString; |
|
93 } |
|
94 |
|
95 //////////////////////////////////////////////////////////// |
|
96 |
|
97 CLogCommentMessage* CLogCommentMessage::NewL(const TDesC8& aComment) |
|
98 { |
|
99 CLogCommentMessage* self = new(ELeave) CLogCommentMessage; |
|
100 CleanupStack::PushL(self); |
|
101 self->iComment = aComment.AllocL(); |
|
102 CleanupStack::Pop(self); |
|
103 return self; |
|
104 } |
|
105 |
|
106 void CLogCommentMessage::Invoke(MLogMessageProtocol& aProtocol) |
|
107 { |
|
108 aProtocol.LogComment(*iComment); |
|
109 } |
|
110 |
|
111 CLogCommentMessage::~CLogCommentMessage() |
|
112 { |
|
113 delete iComment; |
|
114 } |
|
115 |
|
116 CLogCommentMessage::CLogCommentMessage() |
|
117 {} |
|
118 |
|
119 /////////////////////////////////////////////////////////////// |
|
120 |
|
121 void CShutDownMessage::Invoke(MLogMessageProtocol& aProtocol) |
|
122 { |
|
123 aProtocol.ShutDown(); |
|
124 } |