1 /* |
1 /* |
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
43 |
44 |
44 |
45 |
45 class TVideoPlaylistUtilityLog : public TDes16Overflow |
46 class TVideoPlaylistUtilityLog : public TDes16Overflow |
46 { |
47 { |
47 public: |
48 public: |
48 |
|
49 inline static void NullLog( TRefByValue<const TDesC16> /*aFmt*/, ... ) |
49 inline static void NullLog( TRefByValue<const TDesC16> /*aFmt*/, ... ) |
50 { |
50 { |
51 } |
51 } |
52 |
52 |
53 inline static void VideoPlaylistUtilityLog( TRefByValue<const TDesC16> aFmt, ... ) |
53 inline static void VideoPlaylistUtilityLog( TRefByValue<const TDesC16> aFmt, ... ) |
54 { |
54 { |
55 TBuf< 512 > buffer; |
55 TBuf< 512 > buffer; |
56 |
56 |
57 VA_LIST list; |
57 VA_LIST list; |
58 VA_START( list, aFmt ); |
58 VA_START( list, aFmt ); |
59 buffer.AppendFormatList( aFmt, list ); |
59 buffer.AppendFormatList( aFmt, list ); |
60 VA_END(list); |
60 VA_END(list); |
61 |
61 |
74 |
74 |
75 TEnterExitLog( TRefByValue<const TDesC> aFunctionName, |
75 TEnterExitLog( TRefByValue<const TDesC> aFunctionName, |
76 TRefByValue<const TDesC> aFmt, ... ) |
76 TRefByValue<const TDesC> aFmt, ... ) |
77 { |
77 { |
78 iFunctionName = HBufC::New( TDesC(aFunctionName).Length() ); |
78 iFunctionName = HBufC::New( TDesC(aFunctionName).Length() ); |
79 |
79 |
80 if ( iFunctionName ) |
80 if ( iFunctionName ) |
81 { |
81 { |
82 iFunctionName->Des().Copy(aFunctionName); |
82 iFunctionName->Des().Copy(aFunctionName); |
83 } |
83 } |
84 |
84 |
85 TBuf< 512 > buffer; |
85 TBuf< 512 > buffer; |
86 |
86 |
87 VA_LIST list; |
87 VA_LIST list; |
88 VA_START( list, aFmt ); |
88 VA_START( list, aFmt ); |
89 buffer.AppendFormatList( aFmt, list, this ); |
89 buffer.AppendFormatList( aFmt, list, this ); |
90 VA_END(list); |
90 VA_END(list); |
91 |
91 |
92 RDebug::Print(_L("#VideoPlaylistUtility# --> %S %S"), iFunctionName, &buffer ); |
92 RDebug::Print(_L("#VideoPlaylistUtility# --> %S %S"), iFunctionName, &buffer ); |
93 } |
93 } |
94 |
94 |
95 TEnterExitLog( TRefByValue<const TDesC> aFunctionName ) |
95 TEnterExitLog( TRefByValue<const TDesC> aFunctionName ) |
96 { |
96 { |
97 iFunctionName = HBufC::New( TDesC(aFunctionName).Length() ); |
97 iFunctionName = HBufC::New( TDesC(aFunctionName).Length() ); |
98 |
98 |
99 if ( iFunctionName ) |
99 if ( iFunctionName ) |
100 { |
100 { |
101 iFunctionName->Des().Copy(aFunctionName); |
101 iFunctionName->Des().Copy(aFunctionName); |
102 } |
102 } |
103 |
103 |
104 RDebug::Print(_L("#VideoPlaylistUtility# --> %S"), iFunctionName ); |
104 RDebug::Print(_L("#VideoPlaylistUtility# --> %S"), iFunctionName ); |
105 } |
105 } |
106 |
106 |
107 ~TEnterExitLog() |
107 ~TEnterExitLog() |
108 { |
108 { |
109 RDebug::Print(_L("#VideoPlaylistUtility# <-- %S"), iFunctionName ); |
109 RDebug::Print(_L("#VideoPlaylistUtility# <-- %S"), iFunctionName ); |
110 delete iFunctionName; |
110 delete iFunctionName; |
111 } |
111 } |
112 |
112 |
113 private: |
113 private: |
114 HBufC* iFunctionName; |
114 HBufC* iFunctionName; |
115 }; |
115 }; |
116 |
|
117 |
116 |
118 _LIT(_KVPUErrorInfo, "#VideoPlaylistUtility# Error : error %d file %s line %d"); |
117 _LIT(_KVPUErrorInfo, "#VideoPlaylistUtility# Error : error %d file %s line %d"); |
119 |
118 |
120 #define VIDEOPLAYLISTUTILITY_S(a) _S(a) |
119 #define VIDEOPLAYLISTUTILITY_S(a) _S(a) |
121 |
120 |