Coverage Report

Created: 2026-03-07 07:03

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/FreeRDP/winpr/include/winpr/wlog.h
Line
Count
Source
1
/**
2
 * WinPR: Windows Portable Runtime
3
 * WinPR Logger
4
 *
5
 * Copyright 2013 Marc-Andre Moreau <marcandre.moreau@gmail.com>
6
 * Copyright 2015 Thincast Technologies GmbH
7
 * Copyright 2015 Bernhard Miklautz <bernhard.miklautz@thincast.com>
8
 *
9
 *
10
 * Licensed under the Apache License, Version 2.0 (the "License");
11
 * you may not use this file except in compliance with the License.
12
 * You may obtain a copy of the License at
13
 *
14
 *     http://www.apache.org/licenses/LICENSE-2.0
15
 *
16
 * Unless required by applicable law or agreed to in writing, software
17
 * distributed under the License is distributed on an "AS IS" BASIS,
18
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
 * See the License for the specific language governing permissions and
20
 * limitations under the License.
21
 */
22
23
#ifndef WINPR_LOG_H
24
#define WINPR_LOG_H
25
26
#ifdef __cplusplus
27
extern "C"
28
{
29
#endif
30
31
#include <stdarg.h>
32
33
#include <winpr/platform.h>
34
#include <winpr/wtypes.h>
35
#include <winpr/winpr.h>
36
#include <winpr/synch.h>
37
#include <winpr/thread.h>
38
39
/**
40
 * Log Levels
41
 */
42
28.6k
#define WLOG_TRACE 0
43
866
#define WLOG_DEBUG 1
44
1
#define WLOG_INFO 2
45
7.09M
#define WLOG_WARN 3
46
2.46M
#define WLOG_ERROR 4
47
0
#define WLOG_FATAL 5
48
5.35M
#define WLOG_OFF 6
49
2.69M
#define WLOG_LEVEL_INHERIT 0xFFFF
50
51
/** @defgroup LogMessageTypes Log Message
52
 *  @{
53
 */
54
2.65M
#define WLOG_MESSAGE_TEXT 0
55
0
#define WLOG_MESSAGE_DATA 1
56
0
#define WLOG_MESSAGE_IMAGE 2
57
0
#define WLOG_MESSAGE_PACKET 3
58
/**
59
 * @}
60
 */
61
62
/**
63
 * Log Appenders
64
 */
65
3
#define WLOG_APPENDER_CONSOLE 0
66
0
#define WLOG_APPENDER_FILE 1
67
0
#define WLOG_APPENDER_BINARY 2
68
0
#define WLOG_APPENDER_CALLBACK 3
69
0
#define WLOG_APPENDER_SYSLOG 4
70
#define WLOG_APPENDER_JOURNALD 5
71
0
#define WLOG_APPENDER_UDP 6
72
73
  typedef struct
74
  {
75
    DWORD Type;
76
77
    DWORD Level;
78
79
    LPSTR PrefixString;
80
81
    LPCSTR FormatString;
82
    LPCSTR TextString;
83
84
    size_t LineNumber;   /* __LINE__ */
85
    LPCSTR FileName;     /* __FILE__ */
86
    LPCSTR FunctionName; /* __func__ */
87
88
    /* Data Message */
89
90
    void* Data;
91
    size_t Length;
92
93
    /* Image Message */
94
95
    void* ImageData;
96
    size_t ImageWidth;
97
    size_t ImageHeight;
98
    size_t ImageBpp;
99
100
    /* Packet Message */
101
102
    void* PacketData;
103
    size_t PacketLength;
104
    DWORD PacketFlags;
105
  } wLogMessage;
106
  typedef struct s_wLogLayout wLogLayout;
107
  typedef struct s_wLogAppender wLogAppender;
108
  typedef struct s_wLog wLog;
109
110
#define WLOG_PACKET_INBOUND 1
111
0
#define WLOG_PACKET_OUTBOUND 2
112
113
  /** @brief specialized function to print text log messages.
114
   *  Same as @ref WLog_PrintMessage with \b type = WLOG_MESSAGE_TEXT but with compile time checks
115
   * for issues in format string.
116
   *
117
   *  @param log A pointer to the logger to use
118
   *  @param line the file line the log message originates from
119
   *  @param file the file name the log message originates from
120
   *  @param function the function name the log message originates from
121
   *  @param fmt the printf style format string
122
   *
123
   *  @return \b TRUE for success, \b FALSE otherwise.
124
   *  @since version 3.17.0
125
   */
126
  WINPR_ATTR_FORMAT_ARG(6, 7)
127
  WINPR_API BOOL WLog_PrintTextMessage(wLog* log, DWORD level, size_t line, const char* file,
128
                                       const char* function, WINPR_FORMAT_ARG const char* fmt,
129
                                       ...);
130
131
  /** @brief specialized function to print text log messages.
132
   *  Same as @ref WLog_PrintMessageVA with \b type = WLOG_MESSAGE_TEXT but with compile time
133
   * checks for issues in format string.
134
   *
135
   *  @param log A pointer to the logger to use
136
   *  @param line the file line the log message originates from
137
   *  @param file the file name the log message originates from
138
   *  @param function the function name the log message originates from
139
   *  @param fmt the printf style format string
140
   *
141
   *  @return \b TRUE for success, \b FALSE otherwise.
142
   *  @since version 3.17.0
143
   */
144
  WINPR_ATTR_FORMAT_ARG(6, 0)
145
  WINPR_API BOOL WLog_PrintTextMessageVA(wLog* log, DWORD level, size_t line, const char* file,
146
                                         const char* function, WINPR_FORMAT_ARG const char* fmt,
147
                                         va_list args);
148
149
  /** @brief log something of a specified type.
150
   *  @bug For /b WLOG_MESSAGE_TEXT the format string is not validated at compile time. Use \ref
151
   * WLog_PrintTextMessage instead.
152
   *
153
   *  @param log A pointer to the logger to use
154
   *  @param type The type of message to log, can be any of \ref LogMessageTypes
155
   *  @param line the file line the log message originates from
156
   *  @param file the file name the log message originates from
157
   *  @param function the function name the log message originates from
158
   *
159
   *  @return \b TRUE for success, \b FALSE otherwise.
160
   */
161
  WINPR_API BOOL WLog_PrintMessage(wLog* log, DWORD type, DWORD level, size_t line,
162
                                   const char* file, const char* function, ...);
163
164
  /** @brief log something of a specified type.
165
   *  @bug For /b WLOG_MESSAGE_TEXT the format string is not validated at compile time. Use \ref
166
   * WLog_PrintTextMessageVA instead.
167
   *
168
   *  @param log A pointer to the logger to use
169
   *  @param type The type of message to log, can be any of \ref LogMessageTypes
170
   *  @param line the file line the log message originates from
171
   *  @param file the file name the log message originates from
172
   *  @param function the function name the log message originates from
173
   *
174
   *  @return \b TRUE for success, \b FALSE otherwise.
175
   */
176
  WINPR_API BOOL WLog_PrintMessageVA(wLog* log, DWORD type, DWORD level, size_t line,
177
                                     const char* file, const char* function, va_list args);
178
179
  WINPR_ATTR_NODISCARD
180
  WINPR_API wLog* WLog_GetRoot(void);
181
182
  WINPR_ATTR_NODISCARD
183
  WINPR_API wLog* WLog_Get(LPCSTR name);
184
185
  WINPR_ATTR_NODISCARD
186
  WINPR_API DWORD WLog_GetLogLevel(wLog* log);
187
188
  WINPR_ATTR_NODISCARD
189
  WINPR_API BOOL WLog_IsLevelActive(wLog* _log, DWORD _log_level);
190
191
  /** @brief Set a custom context for a dynamic logger.
192
   *  This can be used to print a customized prefix, e.g. some session id for a specific context
193
   *
194
   *  @param log The logger to ste the context for. Must not be \b nullptr
195
   *  @param fkt A function pointer that is called to get the custimized string.
196
   *  @param context A context \b fkt is called with. Caller must ensure it is still allocated
197
   * when \b log is used
198
   *
199
   *  @return \b TRUE for success, \b FALSE otherwise.
200
   */
201
  WINPR_API BOOL WLog_SetContext(wLog* log, const char* (*fkt)(void*), void* context);
202
203
#define WLog_Print_unchecked(_log, _log_level, ...)                                         \
204
182k
  do                                                                                      \
205
182k
  {                                                                                       \
206
182k
    WLog_PrintTextMessage(_log, _log_level, __LINE__, __FILE__, __func__, __VA_ARGS__); \
207
182k
  } while (0)
208
209
#define WLog_Print(_log, _log_level, ...)                        \
210
193k
  do                                                           \
211
193k
  {                                                            \
212
193k
    if (WLog_IsLevelActive(_log, _log_level))                \
213
193k
    {                                                        \
214
182k
      WLog_Print_unchecked(_log, _log_level, __VA_ARGS__); \
215
182k
    }                                                        \
216
193k
  } while (0)
217
218
#define WLog_Print_tag(_tag, _log_level, ...)                 \
219
  do                                                        \
220
  {                                                         \
221
    static wLog* _log_cached_ptr = nullptr;               \
222
    if (!_log_cached_ptr)                                 \
223
      _log_cached_ptr = WLog_Get(_tag);                 \
224
    WLog_Print(_log_cached_ptr, _log_level, __VA_ARGS__); \
225
  } while (0)
226
227
#define WLog_PrintVA_unchecked(_log, _log_level, _fmt, _args)                                 \
228
  do                                                                                        \
229
  {                                                                                         \
230
    WLog_PrintTextMessageVA(_log, _log_level, __LINE__, __FILE__, __func__, _fmt, _args); \
231
  } while (0)
232
233
#define WLog_PrintVA(_log, _log_level, _fmt, _args)                \
234
  do                                                             \
235
  {                                                              \
236
    if (WLog_IsLevelActive(_log, _log_level))                  \
237
    {                                                          \
238
      WLog_PrintVA_unchecked(_log, _log_level, _fmt, _args); \
239
    }                                                          \
240
  } while (0)
241
242
#define WLog_Data(_log, _log_level, ...)                                                         \
243
  do                                                                                           \
244
  {                                                                                            \
245
    if (WLog_IsLevelActive(_log, _log_level))                                                \
246
    {                                                                                        \
247
      WLog_PrintMessage(_log, WLOG_MESSAGE_DATA, _log_level, __LINE__, __FILE__, __func__, \
248
                        __VA_ARGS__);                                                      \
249
    }                                                                                        \
250
  } while (0)
251
252
#define WLog_Image(_log, _log_level, ...)                                                        \
253
  do                                                                                           \
254
  {                                                                                            \
255
    if (WLog_IsLevelActive(_log, _log_level))                                                \
256
    {                                                                                        \
257
      WLog_PrintMessage(_log, WLOG_MESSAGE_DATA, _log_level, __LINE__, __FILE__, __func__, \
258
                        __VA_ARGS__);                                                      \
259
    }                                                                                        \
260
  } while (0)
261
262
#define WLog_Packet(_log, _log_level, ...)                                                         \
263
  do                                                                                             \
264
  {                                                                                              \
265
    if (WLog_IsLevelActive(_log, _log_level))                                                  \
266
    {                                                                                          \
267
      WLog_PrintMessage(_log, WLOG_MESSAGE_PACKET, _log_level, __LINE__, __FILE__, __func__, \
268
                        __VA_ARGS__);                                                        \
269
    }                                                                                          \
270
  } while (0)
271
272
  WINPR_ATTR_FORMAT_ARG(6, 7)
273
  static inline void WLog_Print_dbg_tag(const char* WINPR_RESTRICT tag, DWORD log_level,
274
                                        size_t line, const char* file, const char* fkt,
275
                                        WINPR_FORMAT_ARG const char* fmt, ...)
276
2.50M
  {
277
2.50M
    static wLog* log_cached_ptr = nullptr;
278
2.50M
    if (!log_cached_ptr)
279
23
      log_cached_ptr = WLog_Get(tag);
280
281
2.50M
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
282
2.47M
    {
283
2.47M
      va_list ap = WINPR_C_ARRAY_INIT;
284
2.47M
      va_start(ap, fmt);
285
2.47M
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
286
2.47M
      va_end(ap);
287
2.47M
    }
288
2.50M
  }
Unexecuted instantiation: TestFuzzCodecs.c:WLog_Print_dbg_tag
planar.c:WLog_Print_dbg_tag
Line
Count
Source
276
10.8k
  {
277
10.8k
    static wLog* log_cached_ptr = nullptr;
278
10.8k
    if (!log_cached_ptr)
279
1
      log_cached_ptr = WLog_Get(tag);
280
281
10.8k
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
282
10.8k
    {
283
10.8k
      va_list ap = WINPR_C_ARRAY_INIT;
284
10.8k
      va_start(ap, fmt);
285
10.8k
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
286
      va_end(ap);
287
10.8k
    }
288
10.8k
  }
interleaved.c:WLog_Print_dbg_tag
Line
Count
Source
276
25.5k
  {
277
25.5k
    static wLog* log_cached_ptr = nullptr;
278
25.5k
    if (!log_cached_ptr)
279
1
      log_cached_ptr = WLog_Get(tag);
280
281
25.5k
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
282
25.5k
    {
283
25.5k
      va_list ap = WINPR_C_ARRAY_INIT;
284
25.5k
      va_start(ap, fmt);
285
25.5k
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
286
      va_end(ap);
287
25.5k
    }
288
25.5k
  }
progressive.c:WLog_Print_dbg_tag
Line
Count
Source
276
8.07k
  {
277
8.07k
    static wLog* log_cached_ptr = nullptr;
278
8.07k
    if (!log_cached_ptr)
279
1
      log_cached_ptr = WLog_Get(tag);
280
281
8.07k
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
282
8.07k
    {
283
8.07k
      va_list ap = WINPR_C_ARRAY_INIT;
284
8.07k
      va_start(ap, fmt);
285
8.07k
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
286
      va_end(ap);
287
8.07k
    }
288
8.07k
  }
Unexecuted instantiation: rfx.c:WLog_Print_dbg_tag
region.c:WLog_Print_dbg_tag
Line
Count
Source
276
864
  {
277
864
    static wLog* log_cached_ptr = nullptr;
278
864
    if (!log_cached_ptr)
279
1
      log_cached_ptr = WLog_Get(tag);
280
281
864
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
282
0
    {
283
0
      va_list ap = WINPR_C_ARRAY_INIT;
284
0
      va_start(ap, fmt);
285
0
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
286
      va_end(ap);
287
0
    }
288
864
  }
ncrush.c:WLog_Print_dbg_tag
Line
Count
Source
276
3
  {
277
3
    static wLog* log_cached_ptr = nullptr;
278
3
    if (!log_cached_ptr)
279
1
      log_cached_ptr = WLog_Get(tag);
280
281
3
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
282
3
    {
283
3
      va_list ap = WINPR_C_ARRAY_INIT;
284
3
      va_start(ap, fmt);
285
3
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
286
      va_end(ap);
287
3
    }
288
3
  }
Unexecuted instantiation: xcrush.c:WLog_Print_dbg_tag
mppc.c:WLog_Print_dbg_tag
Line
Count
Source
276
3.90k
  {
277
3.90k
    static wLog* log_cached_ptr = nullptr;
278
3.90k
    if (!log_cached_ptr)
279
1
      log_cached_ptr = WLog_Get(tag);
280
281
3.90k
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
282
3.90k
    {
283
3.90k
      va_list ap = WINPR_C_ARRAY_INIT;
284
3.90k
      va_start(ap, fmt);
285
3.90k
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
286
      va_end(ap);
287
3.90k
    }
288
3.90k
  }
Unexecuted instantiation: zgfx.c:WLog_Print_dbg_tag
clear.c:WLog_Print_dbg_tag
Line
Count
Source
276
29.6k
  {
277
29.6k
    static wLog* log_cached_ptr = nullptr;
278
29.6k
    if (!log_cached_ptr)
279
1
      log_cached_ptr = WLog_Get(tag);
280
281
29.6k
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
282
29.6k
    {
283
29.6k
      va_list ap = WINPR_C_ARRAY_INIT;
284
29.6k
      va_start(ap, fmt);
285
29.6k
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
286
      va_end(ap);
287
29.6k
    }
288
29.6k
  }
rfx_sse2.c:WLog_Print_dbg_tag
Line
Count
Source
276
11.4k
  {
277
11.4k
    static wLog* log_cached_ptr = nullptr;
278
11.4k
    if (!log_cached_ptr)
279
1
      log_cached_ptr = WLog_Get(tag);
280
281
11.4k
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
282
0
    {
283
0
      va_list ap = WINPR_C_ARRAY_INIT;
284
0
      va_start(ap, fmt);
285
0
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
286
      va_end(ap);
287
0
    }
288
11.4k
  }
Unexecuted instantiation: rfx_neon.c:WLog_Print_dbg_tag
primitives.c:WLog_Print_dbg_tag
Line
Count
Source
276
2
  {
277
2
    static wLog* log_cached_ptr = nullptr;
278
2
    if (!log_cached_ptr)
279
1
      log_cached_ptr = WLog_Get(tag);
280
281
2
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
282
0
    {
283
0
      va_list ap = WINPR_C_ARRAY_INIT;
284
0
      va_start(ap, fmt);
285
0
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
286
      va_end(ap);
287
0
    }
288
2
  }
Unexecuted instantiation: helpers.c:WLog_Print_dbg_tag
color.c:WLog_Print_dbg_tag
Line
Count
Source
276
2.39M
  {
277
2.39M
    static wLog* log_cached_ptr = nullptr;
278
2.39M
    if (!log_cached_ptr)
279
1
      log_cached_ptr = WLog_Get(tag);
280
281
2.39M
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
282
2.39M
    {
283
2.39M
      va_list ap = WINPR_C_ARRAY_INIT;
284
2.39M
      va_start(ap, fmt);
285
2.39M
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
286
      va_end(ap);
287
2.39M
    }
288
2.39M
  }
Unexecuted instantiation: bitmap.c:WLog_Print_dbg_tag
Unexecuted instantiation: rfx_decode.c:WLog_Print_dbg_tag
Unexecuted instantiation: rfx_dwt.c:WLog_Print_dbg_tag
Unexecuted instantiation: rfx_encode.c:WLog_Print_dbg_tag
Unexecuted instantiation: rfx_quantization.c:WLog_Print_dbg_tag
Unexecuted instantiation: rfx_rlgr.c:WLog_Print_dbg_tag
Unexecuted instantiation: nsc.c:WLog_Print_dbg_tag
Unexecuted instantiation: nsc_encode.c:WLog_Print_dbg_tag
nsc_sse2.c:WLog_Print_dbg_tag
Line
Count
Source
276
17.1k
  {
277
17.1k
    static wLog* log_cached_ptr = nullptr;
278
17.1k
    if (!log_cached_ptr)
279
1
      log_cached_ptr = WLog_Get(tag);
280
281
17.1k
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
282
0
    {
283
0
      va_list ap = WINPR_C_ARRAY_INIT;
284
0
      va_start(ap, fmt);
285
0
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
286
      va_end(ap);
287
0
    }
288
17.1k
  }
Unexecuted instantiation: nsc_neon.c:WLog_Print_dbg_tag
Unexecuted instantiation: prim_add.c:WLog_Print_dbg_tag
Unexecuted instantiation: prim_andor.c:WLog_Print_dbg_tag
Unexecuted instantiation: prim_alphaComp.c:WLog_Print_dbg_tag
Unexecuted instantiation: prim_colors.c:WLog_Print_dbg_tag
prim_copy.c:WLog_Print_dbg_tag
Line
Count
Source
276
701
  {
277
701
    static wLog* log_cached_ptr = nullptr;
278
701
    if (!log_cached_ptr)
279
1
      log_cached_ptr = WLog_Get(tag);
280
281
701
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
282
701
    {
283
701
      va_list ap = WINPR_C_ARRAY_INIT;
284
701
      va_start(ap, fmt);
285
701
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
286
      va_end(ap);
287
701
    }
288
701
  }
Unexecuted instantiation: prim_set.c:WLog_Print_dbg_tag
Unexecuted instantiation: prim_shift.c:WLog_Print_dbg_tag
Unexecuted instantiation: prim_sign.c:WLog_Print_dbg_tag
Unexecuted instantiation: prim_YUV.c:WLog_Print_dbg_tag
Unexecuted instantiation: prim_YCoCg.c:WLog_Print_dbg_tag
Unexecuted instantiation: prim_colors_neon.c:WLog_Print_dbg_tag
Unexecuted instantiation: prim_YCoCg_neon.c:WLog_Print_dbg_tag
Unexecuted instantiation: prim_YUV_neon.c:WLog_Print_dbg_tag
prim_colors_sse2.c:WLog_Print_dbg_tag
Line
Count
Source
276
1
  {
277
1
    static wLog* log_cached_ptr = nullptr;
278
1
    if (!log_cached_ptr)
279
1
      log_cached_ptr = WLog_Get(tag);
280
281
1
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
282
0
    {
283
0
      va_list ap = WINPR_C_ARRAY_INIT;
284
0
      va_start(ap, fmt);
285
0
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
286
      va_end(ap);
287
0
    }
288
1
  }
prim_set_sse2.c:WLog_Print_dbg_tag
Line
Count
Source
276
1
  {
277
1
    static wLog* log_cached_ptr = nullptr;
278
1
    if (!log_cached_ptr)
279
1
      log_cached_ptr = WLog_Get(tag);
280
281
1
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
282
0
    {
283
0
      va_list ap = WINPR_C_ARRAY_INIT;
284
0
      va_start(ap, fmt);
285
0
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
286
      va_end(ap);
287
0
    }
288
1
  }
prim_add_sse3.c:WLog_Print_dbg_tag
Line
Count
Source
276
1
  {
277
1
    static wLog* log_cached_ptr = nullptr;
278
1
    if (!log_cached_ptr)
279
1
      log_cached_ptr = WLog_Get(tag);
280
281
1
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
282
0
    {
283
0
      va_list ap = WINPR_C_ARRAY_INIT;
284
0
      va_start(ap, fmt);
285
0
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
286
      va_end(ap);
287
0
    }
288
1
  }
prim_alphaComp_sse3.c:WLog_Print_dbg_tag
Line
Count
Source
276
1
  {
277
1
    static wLog* log_cached_ptr = nullptr;
278
1
    if (!log_cached_ptr)
279
1
      log_cached_ptr = WLog_Get(tag);
280
281
1
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
282
0
    {
283
0
      va_list ap = WINPR_C_ARRAY_INIT;
284
0
      va_start(ap, fmt);
285
0
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
286
      va_end(ap);
287
0
    }
288
1
  }
prim_andor_sse3.c:WLog_Print_dbg_tag
Line
Count
Source
276
1
  {
277
1
    static wLog* log_cached_ptr = nullptr;
278
1
    if (!log_cached_ptr)
279
1
      log_cached_ptr = WLog_Get(tag);
280
281
1
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
282
0
    {
283
0
      va_list ap = WINPR_C_ARRAY_INIT;
284
0
      va_start(ap, fmt);
285
0
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
286
      va_end(ap);
287
0
    }
288
1
  }
prim_shift_sse3.c:WLog_Print_dbg_tag
Line
Count
Source
276
1
  {
277
1
    static wLog* log_cached_ptr = nullptr;
278
1
    if (!log_cached_ptr)
279
1
      log_cached_ptr = WLog_Get(tag);
280
281
1
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
282
0
    {
283
0
      va_list ap = WINPR_C_ARRAY_INIT;
284
0
      va_start(ap, fmt);
285
0
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
286
      va_end(ap);
287
0
    }
288
1
  }
prim_sign_ssse3.c:WLog_Print_dbg_tag
Line
Count
Source
276
1
  {
277
1
    static wLog* log_cached_ptr = nullptr;
278
1
    if (!log_cached_ptr)
279
1
      log_cached_ptr = WLog_Get(tag);
280
281
1
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
282
0
    {
283
0
      va_list ap = WINPR_C_ARRAY_INIT;
284
0
      va_start(ap, fmt);
285
0
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
286
      va_end(ap);
287
0
    }
288
1
  }
prim_YCoCg_ssse3.c:WLog_Print_dbg_tag
Line
Count
Source
276
1
  {
277
1
    static wLog* log_cached_ptr = nullptr;
278
1
    if (!log_cached_ptr)
279
1
      log_cached_ptr = WLog_Get(tag);
280
281
1
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
282
0
    {
283
0
      va_list ap = WINPR_C_ARRAY_INIT;
284
0
      va_start(ap, fmt);
285
0
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
286
      va_end(ap);
287
0
    }
288
1
  }
prim_copy_sse4_1.c:WLog_Print_dbg_tag
Line
Count
Source
276
1
  {
277
1
    static wLog* log_cached_ptr = nullptr;
278
1
    if (!log_cached_ptr)
279
1
      log_cached_ptr = WLog_Get(tag);
280
281
1
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
282
0
    {
283
0
      va_list ap = WINPR_C_ARRAY_INIT;
284
0
      va_start(ap, fmt);
285
0
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
286
      va_end(ap);
287
0
    }
288
1
  }
prim_YUV_sse4.1.c:WLog_Print_dbg_tag
Line
Count
Source
276
1
  {
277
1
    static wLog* log_cached_ptr = nullptr;
278
1
    if (!log_cached_ptr)
279
1
      log_cached_ptr = WLog_Get(tag);
280
281
1
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
282
0
    {
283
0
      va_list ap = WINPR_C_ARRAY_INIT;
284
0
      va_start(ap, fmt);
285
0
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
286
      va_end(ap);
287
0
    }
288
1
  }
prim_copy_avx2.c:WLog_Print_dbg_tag
Line
Count
Source
276
1
  {
277
1
    static wLog* log_cached_ptr = nullptr;
278
1
    if (!log_cached_ptr)
279
1
      log_cached_ptr = WLog_Get(tag);
280
281
1
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
282
0
    {
283
0
      va_list ap = WINPR_C_ARRAY_INIT;
284
0
      va_start(ap, fmt);
285
0
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
286
      va_end(ap);
287
0
    }
288
1
  }
Unexecuted instantiation: init.c:WLog_Print_dbg_tag
Unexecuted instantiation: sleep.c:WLog_Print_dbg_tag
Unexecuted instantiation: interlocked.c:WLog_Print_dbg_tag
Unexecuted instantiation: registry.c:WLog_Print_dbg_tag
Unexecuted instantiation: path.c:WLog_Print_dbg_tag
Unexecuted instantiation: shell.c:WLog_Print_dbg_tag
Unexecuted instantiation: json.c:WLog_Print_dbg_tag
Unexecuted instantiation: stream.c:WLog_Print_dbg_tag
Unexecuted instantiation: debug.c:WLog_Print_dbg_tag
Unexecuted instantiation: winpr.c:WLog_Print_dbg_tag
Unexecuted instantiation: BitStream.c:WLog_Print_dbg_tag
Unexecuted instantiation: HashTable.c:WLog_Print_dbg_tag
Unexecuted instantiation: BufferPool.c:WLog_Print_dbg_tag
Unexecuted instantiation: ObjectPool.c:WLog_Print_dbg_tag
Unexecuted instantiation: wlog.c:WLog_Print_dbg_tag
Unexecuted instantiation: Appender.c:WLog_Print_dbg_tag
Unexecuted instantiation: FileAppender.c:WLog_Print_dbg_tag
Unexecuted instantiation: BinaryAppender.c:WLog_Print_dbg_tag
Unexecuted instantiation: CallbackAppender.c:WLog_Print_dbg_tag
Unexecuted instantiation: ConsoleAppender.c:WLog_Print_dbg_tag
Unexecuted instantiation: UdpAppender.c:WLog_Print_dbg_tag
Unexecuted instantiation: SyslogAppender.c:WLog_Print_dbg_tag
Unexecuted instantiation: error.c:WLog_Print_dbg_tag
Unexecuted instantiation: sysinfo.c:WLog_Print_dbg_tag
Unexecuted instantiation: work.c:WLog_Print_dbg_tag
Unexecuted instantiation: pool.c:WLog_Print_dbg_tag
Unexecuted instantiation: handle.c:WLog_Print_dbg_tag
Unexecuted instantiation: apc.c:WLog_Print_dbg_tag
Unexecuted instantiation: process.c:WLog_Print_dbg_tag
Unexecuted instantiation: thread.c:WLog_Print_dbg_tag
Unexecuted instantiation: winsock.c:WLog_Print_dbg_tag
Unexecuted instantiation: alignment.c:WLog_Print_dbg_tag
Unexecuted instantiation: unicode.c:WLog_Print_dbg_tag
Unexecuted instantiation: string.c:WLog_Print_dbg_tag
Unexecuted instantiation: assert.c:WLog_Print_dbg_tag
Unexecuted instantiation: unicode_builtin.c:WLog_Print_dbg_tag
Unexecuted instantiation: nt.c:WLog_Print_dbg_tag
Unexecuted instantiation: critical.c:WLog_Print_dbg_tag
Unexecuted instantiation: event.c:WLog_Print_dbg_tag
Unexecuted instantiation: pollset.c:WLog_Print_dbg_tag
Unexecuted instantiation: wait.c:WLog_Print_dbg_tag
Unexecuted instantiation: generic.c:WLog_Print_dbg_tag
Unexecuted instantiation: namedPipeClient.c:WLog_Print_dbg_tag
Unexecuted instantiation: pattern.c:WLog_Print_dbg_tag
Unexecuted instantiation: file.c:WLog_Print_dbg_tag
Unexecuted instantiation: comm.c:WLog_Print_dbg_tag
Unexecuted instantiation: comm_ioctl.c:WLog_Print_dbg_tag
Unexecuted instantiation: comm_serial_sys.c:WLog_Print_dbg_tag
Unexecuted instantiation: comm_sercx_sys.c:WLog_Print_dbg_tag
Unexecuted instantiation: comm_sercx2_sys.c:WLog_Print_dbg_tag
Unexecuted instantiation: pipe.c:WLog_Print_dbg_tag
Unexecuted instantiation: environment.c:WLog_Print_dbg_tag
Unexecuted instantiation: registry_reg.c:WLog_Print_dbg_tag
Unexecuted instantiation: json-c.c:WLog_Print_dbg_tag
Unexecuted instantiation: atexit.c:WLog_Print_dbg_tag
Unexecuted instantiation: Object.c:WLog_Print_dbg_tag
Unexecuted instantiation: Queue.c:WLog_Print_dbg_tag
Unexecuted instantiation: ArrayList.c:WLog_Print_dbg_tag
Unexecuted instantiation: CountdownEvent.c:WLog_Print_dbg_tag
Unexecuted instantiation: Layout.c:WLog_Print_dbg_tag
Unexecuted instantiation: Message.c:WLog_Print_dbg_tag
Unexecuted instantiation: DataMessage.c:WLog_Print_dbg_tag
Unexecuted instantiation: ImageMessage.c:WLog_Print_dbg_tag
Unexecuted instantiation: PacketMessage.c:WLog_Print_dbg_tag
Unexecuted instantiation: argv.c:WLog_Print_dbg_tag
Unexecuted instantiation: comm_io.c:WLog_Print_dbg_tag
Unexecuted instantiation: image.c:WLog_Print_dbg_tag
289
290
#define WLog_LVL(tag, lvl, ...) \
291
0
  WLog_Print_dbg_tag(tag, lvl, __LINE__, __FILE__, __func__, __VA_ARGS__)
292
#define WLog_VRB(tag, ...) \
293
28.6k
  WLog_Print_dbg_tag(tag, WLOG_TRACE, __LINE__, __FILE__, __func__, __VA_ARGS__)
294
#define WLog_DBG(tag, ...) \
295
866
  WLog_Print_dbg_tag(tag, WLOG_DEBUG, __LINE__, __FILE__, __func__, __VA_ARGS__)
296
#define WLog_INFO(tag, ...) \
297
  WLog_Print_dbg_tag(tag, WLOG_INFO, __LINE__, __FILE__, __func__, __VA_ARGS__)
298
#define WLog_WARN(tag, ...) \
299
13.7k
  WLog_Print_dbg_tag(tag, WLOG_WARN, __LINE__, __FILE__, __func__, __VA_ARGS__)
300
#define WLog_ERR(tag, ...) \
301
2.46M
  WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
302
#define WLog_FATAL(tag, ...) \
303
0
  WLog_Print_dbg_tag(tag, WLOG_FATAL, __LINE__, __FILE__, __func__, __VA_ARGS__)
304
305
  WINPR_ATTR_NODISCARD
306
  WINPR_API BOOL WLog_SetLogLevel(wLog* log, DWORD logLevel);
307
308
  WINPR_ATTR_NODISCARD
309
  WINPR_API BOOL WLog_SetStringLogLevel(wLog* log, LPCSTR level);
310
311
  WINPR_ATTR_NODISCARD
312
  WINPR_API BOOL WLog_AddStringLogFilters(LPCSTR filter);
313
314
  WINPR_ATTR_NODISCARD
315
  WINPR_API BOOL WLog_SetLogAppenderType(wLog* log, DWORD logAppenderType);
316
317
  WINPR_ATTR_NODISCARD
318
  WINPR_API wLogAppender* WLog_GetLogAppender(wLog* log);
319
320
  WINPR_ATTR_NODISCARD
321
  WINPR_API BOOL WLog_OpenAppender(wLog* log);
322
323
  WINPR_ATTR_NODISCARD
324
  WINPR_API BOOL WLog_CloseAppender(wLog* log);
325
326
  WINPR_ATTR_NODISCARD
327
  WINPR_API BOOL WLog_ConfigureAppender(wLogAppender* appender, const char* setting, void* value);
328
329
  WINPR_ATTR_NODISCARD
330
  WINPR_API wLogLayout* WLog_GetLogLayout(wLog* log);
331
332
  WINPR_ATTR_NODISCARD
333
  WINPR_API BOOL WLog_Layout_SetPrefixFormat(wLog* log, wLogLayout* layout, const char* format);
334
335
#if defined(WITH_WINPR_DEPRECATED)
336
  /** Deprecated */
337
  WINPR_DEPRECATED(WINPR_ATTR_NODISCARD WINPR_API BOOL WLog_Init(void));
338
339
  /** Deprecated */
340
  WINPR_DEPRECATED(WINPR_ATTR_NODISCARD WINPR_API BOOL WLog_Uninit(void));
341
#endif
342
343
  typedef BOOL (*wLogCallbackMessage_t)(const wLogMessage* msg);
344
  typedef BOOL (*wLogCallbackData_t)(const wLogMessage* msg);
345
  typedef BOOL (*wLogCallbackImage_t)(const wLogMessage* msg);
346
  typedef BOOL (*wLogCallbackPackage_t)(const wLogMessage* msg);
347
348
  typedef struct
349
  {
350
    WINPR_ATTR_NODISCARD wLogCallbackData_t data;
351
    WINPR_ATTR_NODISCARD wLogCallbackImage_t image;
352
    WINPR_ATTR_NODISCARD wLogCallbackMessage_t message;
353
    WINPR_ATTR_NODISCARD wLogCallbackPackage_t package;
354
  } wLogCallbacks;
355
356
#ifdef __cplusplus
357
}
358
#endif
359
360
#endif /* WINPR_WLOG_H */