This repository has been archived by the owner on Jan 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
AampFnLogger.h
171 lines (138 loc) · 3.7 KB
/
AampFnLogger.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
/*
* If not stated otherwise in this file or this component's license file the
* following copyright and licenses apply:
*
* Copyright 2021 RDK Management
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file AampFnLogger.h
* @brief AAMP Log unitility
*/
#ifndef AAMPFNLOGGER_H
#define AAMPFNLOGGER_H
#include <stddef.h>
extern void logprintf(const char *format, ...);
extern void logprintf_new(int playerId,const char* levelstr,const char* file, int line,const char *format, ...);
/**
* @class FnLogger
* @brief Enable Logger to add more logs
*/
class FnLogger {
public:
FnLogger( std::string const & pMsg1,std::string const & pMsg2 ) : msg1(pMsg1),msg2(pMsg2)
{ logprintf("%s Enter ===> %s(): ", msg1.c_str(), msg2.c_str()); }
~FnLogger()
{ logprintf("%s Exit <=== %s(): ", msg1.c_str(), msg2.c_str()); }
std::string msg1;
std::string msg2;
};
#ifndef LOG_FN_TRACE
#define LOG_FN_TRACE 0
#endif
#ifndef LOG_FN_TRACE_P
#define LOG_FN_TRACE_P 0
#endif
#ifndef LOG_FN_TRACE_F_MPD
#define LOG_FN_TRACE_F_MPD 0
#endif
#ifndef LOG_FN_TRACE_G_CONF
#define LOG_FN_TRACE_G_CONF 0
#endif
#ifndef LOG_FN_TRACE_DMX
#define LOG_FN_TRACE_DMX 0
#endif
#ifndef LOG_FN_TRACE_STRM_ABS
#define LOG_FN_TRACE_STRM_ABS 0
#endif
#ifndef LOG_FN_TRACE_STRM_PROG
#define LOG_FN_TRACE_STRM_PROG 0
#endif
#ifndef LOG_FN_TRACE_PROFILER
#define LOG_FN_TRACE_PROFILER 0
#endif
#ifndef LOG_FN_TRACE_CDAI
#define LOG_FN_TRACE_CDAI 0
#endif
#ifndef LOG_FN_TRACE_DRM
#define LOG_FN_TRACE_DRM 0
#endif
#ifndef LOG_FN_TRACE_DRM_SMGR
#define LOG_FN_TRACE_DRM_SMGR 0
#endif
#ifndef LOG_FN_TRACE_ISOBMFF
#define LOG_FN_TRACE_ISOBMFF 0
#endif
//===========================================
#if LOG_FN_TRACE
#define FN_TRACE(x) FnLogger l_##x##_scope("[GST-PLAYER]",x);
#else
#define FN_TRACE(x)
#endif
#if LOG_FN_TRACE_P
#define FN_TRACE_P(x) FnLogger l_##x##_scope("[GST-PLAYER-PVT]",x);
#else
#define FN_TRACE_P(x)
#endif
#if LOG_FN_TRACE_F_MPD
#define FN_TRACE_F_MPD(x) FnLogger l_##x##_scope("[F-MPD]",x);
#else
#define FN_TRACE_F_MPD(x)
#endif
#if LOG_FN_TRACE_G_CONF
#define FN_TRACE_G_CONF(x) FnLogger l_##x##_scope("[G-CONF]",x);
#else
#define FN_TRACE_G_CONF(x)
#endif
#if LOG_FN_TRACE_DMX
#define FN_TRACE_DMX(x) FnLogger l_##x##_scope("[DMX]",x);
#else
#define FN_TRACE_DMX(x)
#endif
#if LOG_FN_TRACE_STRM_ABS
#define FN_TRACE_STRM_ABS(x) FnLogger l_##x##_scope("[STRM-ABS]",x);
#else
#define FN_TRACE_STRM_ABS(x)
#endif
#if LOG_FN_TRACE_STRM_PROG
#define FN_TRACE_STRM_PROG(x) FnLogger l_##x##_scope("[STRM-PROG]",x);
#else
#define FN_TRACE_STRM_PROG(x)
#endif
#if LOG_FN_TRACE_PROFILER
#define FN_TRACE_PROFILER(x) FnLogger l_##x##_scope("[PROFILER]",x);
#else
#define FN_TRACE_PROFILER(x)
#endif
#if LOG_FN_TRACE_CDAI
#define FN_TRACE_CDAI(x) FnLogger l_##x##_scope("[CDAI]",x);
#else
#define FN_TRACE_CDAI(x)
#endif
#if LOG_FN_TRACE_DRM
#define FN_TRACE_DRM(x) FnLogger l_##x##_scope("[DRM]",x);
#else
#define FN_TRACE_DRM(x)
#endif
#if LOG_FN_TRACE_DRM_SMGR
#define FN_TRACE_DRM_SMGR(x) FnLogger l_##x##_scope("[DRM-SMGR]",x);
#else
#define FN_TRACE_DRM_SMGR(x)
#endif
#if LOG_FN_TRACE_ISOBMFF
#define FN_TRACE_ISOBMFF(x) FnLogger l_##x##_scope("[ISOBMFF]",x);
#else
#define FN_TRACE_ISOBMFF(x)
#endif
#endif // AAMPFNLOGGER_H