Coverage Report

Created: 2026-04-12 06:59

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
29.4k
#define WLOG_TRACE 0
43
883
#define WLOG_DEBUG 1
44
1
#define WLOG_INFO 2
45
5.77M
#define WLOG_WARN 3
46
2.83M
#define WLOG_ERROR 4
47
0
#define WLOG_FATAL 5
48
6.15M
#define WLOG_OFF 6
49
3.09M
#define WLOG_LEVEL_INHERIT 0xFFFF
50
51
/** @defgroup LogMessageTypes Log Message
52
 *  @{
53
 */
54
3.05M
#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
  /** @brief Set a application wide global logger prefix.
204
   *  This can be used to distinguish WLog entries from different applicatiions like
205
   * freerpd-shadow-cli and xfreerdp. It also allows setting a dynamic prefix depending on command
206
   * line arguments to separate different xfreerdp instances.
207
   *
208
   * @warning This function should only be called directly after \b main before any threads start
209
   * up. Thread safety is undefined!
210
   *
211
   *  @param globalprefix Set a global prefix string prepended to all logger entries. Use \b
212
   * nullptr to disable prefix.
213
   *  @return \b TRUE for success, \b FALSE otherwise.
214
   *  @version since 3.25.0
215
   */
216
  WINPR_API BOOL WLog_SetGlobalContext(const char* globalprefix);
217
218
#define WLog_Print_unchecked(_log, _log_level, ...)                                         \
219
214k
  do                                                                                      \
220
214k
  {                                                                                       \
221
214k
    WLog_PrintTextMessage(_log, _log_level, __LINE__, __FILE__, __func__, __VA_ARGS__); \
222
214k
  } while (0)
223
224
#define WLog_Print(_log, _log_level, ...)                        \
225
224k
  do                                                           \
226
224k
  {                                                            \
227
224k
    if (WLog_IsLevelActive(_log, _log_level))                \
228
224k
    {                                                        \
229
214k
      WLog_Print_unchecked(_log, _log_level, __VA_ARGS__); \
230
214k
    }                                                        \
231
224k
  } while (0)
232
233
#define WLog_Print_tag(_tag, _log_level, ...)                 \
234
  do                                                        \
235
  {                                                         \
236
    static wLog* _log_cached_ptr = nullptr;               \
237
    if (!_log_cached_ptr)                                 \
238
      _log_cached_ptr = WLog_Get(_tag);                 \
239
    WLog_Print(_log_cached_ptr, _log_level, __VA_ARGS__); \
240
  } while (0)
241
242
#define WLog_PrintVA_unchecked(_log, _log_level, _fmt, _args)                                 \
243
  do                                                                                        \
244
  {                                                                                         \
245
    WLog_PrintTextMessageVA(_log, _log_level, __LINE__, __FILE__, __func__, _fmt, _args); \
246
  } while (0)
247
248
#define WLog_PrintVA(_log, _log_level, _fmt, _args)                \
249
  do                                                             \
250
  {                                                              \
251
    if (WLog_IsLevelActive(_log, _log_level))                  \
252
    {                                                          \
253
      WLog_PrintVA_unchecked(_log, _log_level, _fmt, _args); \
254
    }                                                          \
255
  } while (0)
256
257
#define WLog_Data(_log, _log_level, ...)                                                         \
258
  do                                                                                           \
259
  {                                                                                            \
260
    if (WLog_IsLevelActive(_log, _log_level))                                                \
261
    {                                                                                        \
262
      WLog_PrintMessage(_log, WLOG_MESSAGE_DATA, _log_level, __LINE__, __FILE__, __func__, \
263
                        __VA_ARGS__);                                                      \
264
    }                                                                                        \
265
  } while (0)
266
267
#define WLog_Image(_log, _log_level, ...)                                                        \
268
  do                                                                                           \
269
  {                                                                                            \
270
    if (WLog_IsLevelActive(_log, _log_level))                                                \
271
    {                                                                                        \
272
      WLog_PrintMessage(_log, WLOG_MESSAGE_DATA, _log_level, __LINE__, __FILE__, __func__, \
273
                        __VA_ARGS__);                                                      \
274
    }                                                                                        \
275
  } while (0)
276
277
#define WLog_Packet(_log, _log_level, ...)                                                         \
278
  do                                                                                             \
279
  {                                                                                              \
280
    if (WLog_IsLevelActive(_log, _log_level))                                                  \
281
    {                                                                                          \
282
      WLog_PrintMessage(_log, WLOG_MESSAGE_PACKET, _log_level, __LINE__, __FILE__, __func__, \
283
                        __VA_ARGS__);                                                        \
284
    }                                                                                          \
285
  } while (0)
286
287
  WINPR_ATTR_FORMAT_ARG(6, 7)
288
  static inline void WLog_Print_dbg_tag(const char* WINPR_RESTRICT tag, DWORD log_level,
289
                                        size_t line, const char* file, const char* fkt,
290
                                        WINPR_FORMAT_ARG const char* fmt, ...)
291
2.87M
  {
292
2.87M
    static wLog* log_cached_ptr = nullptr;
293
2.87M
    if (!log_cached_ptr)
294
22
      log_cached_ptr = WLog_Get(tag);
295
296
2.87M
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
297
2.84M
    {
298
2.84M
      va_list ap = WINPR_C_ARRAY_INIT;
299
2.84M
      va_start(ap, fmt);
300
2.84M
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
301
2.84M
      va_end(ap);
302
2.84M
    }
303
2.87M
  }
Unexecuted instantiation: TestFuzzCodecs.c:WLog_Print_dbg_tag
planar.c:WLog_Print_dbg_tag
Line
Count
Source
291
11.0k
  {
292
11.0k
    static wLog* log_cached_ptr = nullptr;
293
11.0k
    if (!log_cached_ptr)
294
1
      log_cached_ptr = WLog_Get(tag);
295
296
11.0k
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
297
11.0k
    {
298
11.0k
      va_list ap = WINPR_C_ARRAY_INIT;
299
11.0k
      va_start(ap, fmt);
300
11.0k
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
301
      va_end(ap);
302
11.0k
    }
303
11.0k
  }
interleaved.c:WLog_Print_dbg_tag
Line
Count
Source
291
26.6k
  {
292
26.6k
    static wLog* log_cached_ptr = nullptr;
293
26.6k
    if (!log_cached_ptr)
294
1
      log_cached_ptr = WLog_Get(tag);
295
296
26.6k
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
297
26.6k
    {
298
26.6k
      va_list ap = WINPR_C_ARRAY_INIT;
299
26.6k
      va_start(ap, fmt);
300
26.6k
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
301
      va_end(ap);
302
26.6k
    }
303
26.6k
  }
progressive.c:WLog_Print_dbg_tag
Line
Count
Source
291
9.36k
  {
292
9.36k
    static wLog* log_cached_ptr = nullptr;
293
9.36k
    if (!log_cached_ptr)
294
1
      log_cached_ptr = WLog_Get(tag);
295
296
9.36k
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
297
9.36k
    {
298
9.36k
      va_list ap = WINPR_C_ARRAY_INIT;
299
9.36k
      va_start(ap, fmt);
300
9.36k
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
301
      va_end(ap);
302
9.36k
    }
303
9.36k
  }
Unexecuted instantiation: rfx.c:WLog_Print_dbg_tag
region.c:WLog_Print_dbg_tag
Line
Count
Source
291
881
  {
292
881
    static wLog* log_cached_ptr = nullptr;
293
881
    if (!log_cached_ptr)
294
1
      log_cached_ptr = WLog_Get(tag);
295
296
881
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
297
0
    {
298
0
      va_list ap = WINPR_C_ARRAY_INIT;
299
0
      va_start(ap, fmt);
300
0
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
301
      va_end(ap);
302
0
    }
303
881
  }
ncrush.c:WLog_Print_dbg_tag
Line
Count
Source
291
4
  {
292
4
    static wLog* log_cached_ptr = nullptr;
293
4
    if (!log_cached_ptr)
294
1
      log_cached_ptr = WLog_Get(tag);
295
296
4
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
297
4
    {
298
4
      va_list ap = WINPR_C_ARRAY_INIT;
299
4
      va_start(ap, fmt);
300
4
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
301
      va_end(ap);
302
4
    }
303
4
  }
Unexecuted instantiation: xcrush.c:WLog_Print_dbg_tag
mppc.c:WLog_Print_dbg_tag
Line
Count
Source
291
3.92k
  {
292
3.92k
    static wLog* log_cached_ptr = nullptr;
293
3.92k
    if (!log_cached_ptr)
294
1
      log_cached_ptr = WLog_Get(tag);
295
296
3.92k
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
297
3.92k
    {
298
3.92k
      va_list ap = WINPR_C_ARRAY_INIT;
299
3.92k
      va_start(ap, fmt);
300
3.92k
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
301
      va_end(ap);
302
3.92k
    }
303
3.92k
  }
Unexecuted instantiation: zgfx.c:WLog_Print_dbg_tag
Unexecuted instantiation: clear.c:WLog_Print_dbg_tag
rfx_sse2.c:WLog_Print_dbg_tag
Line
Count
Source
291
11.7k
  {
292
11.7k
    static wLog* log_cached_ptr = nullptr;
293
11.7k
    if (!log_cached_ptr)
294
1
      log_cached_ptr = WLog_Get(tag);
295
296
11.7k
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
297
0
    {
298
0
      va_list ap = WINPR_C_ARRAY_INIT;
299
0
      va_start(ap, fmt);
300
0
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
301
      va_end(ap);
302
0
    }
303
11.7k
  }
Unexecuted instantiation: rfx_neon.c:WLog_Print_dbg_tag
primitives.c:WLog_Print_dbg_tag
Line
Count
Source
291
2
  {
292
2
    static wLog* log_cached_ptr = nullptr;
293
2
    if (!log_cached_ptr)
294
1
      log_cached_ptr = WLog_Get(tag);
295
296
2
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
297
0
    {
298
0
      va_list ap = WINPR_C_ARRAY_INIT;
299
0
      va_start(ap, fmt);
300
0
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
301
      va_end(ap);
302
0
    }
303
2
  }
Unexecuted instantiation: helpers.c:WLog_Print_dbg_tag
color.c:WLog_Print_dbg_tag
Line
Count
Source
291
2.79M
  {
292
2.79M
    static wLog* log_cached_ptr = nullptr;
293
2.79M
    if (!log_cached_ptr)
294
1
      log_cached_ptr = WLog_Get(tag);
295
296
2.79M
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
297
2.79M
    {
298
2.79M
      va_list ap = WINPR_C_ARRAY_INIT;
299
2.79M
      va_start(ap, fmt);
300
2.79M
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
301
      va_end(ap);
302
2.79M
    }
303
2.79M
  }
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
291
17.6k
  {
292
17.6k
    static wLog* log_cached_ptr = nullptr;
293
17.6k
    if (!log_cached_ptr)
294
1
      log_cached_ptr = WLog_Get(tag);
295
296
17.6k
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
297
0
    {
298
0
      va_list ap = WINPR_C_ARRAY_INIT;
299
0
      va_start(ap, fmt);
300
0
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
301
      va_end(ap);
302
0
    }
303
17.6k
  }
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
291
718
  {
292
718
    static wLog* log_cached_ptr = nullptr;
293
718
    if (!log_cached_ptr)
294
1
      log_cached_ptr = WLog_Get(tag);
295
296
718
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
297
718
    {
298
718
      va_list ap = WINPR_C_ARRAY_INIT;
299
718
      va_start(ap, fmt);
300
718
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
301
      va_end(ap);
302
718
    }
303
718
  }
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
291
1
  {
292
1
    static wLog* log_cached_ptr = nullptr;
293
1
    if (!log_cached_ptr)
294
1
      log_cached_ptr = WLog_Get(tag);
295
296
1
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
297
0
    {
298
0
      va_list ap = WINPR_C_ARRAY_INIT;
299
0
      va_start(ap, fmt);
300
0
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
301
      va_end(ap);
302
0
    }
303
1
  }
prim_set_sse2.c:WLog_Print_dbg_tag
Line
Count
Source
291
1
  {
292
1
    static wLog* log_cached_ptr = nullptr;
293
1
    if (!log_cached_ptr)
294
1
      log_cached_ptr = WLog_Get(tag);
295
296
1
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
297
0
    {
298
0
      va_list ap = WINPR_C_ARRAY_INIT;
299
0
      va_start(ap, fmt);
300
0
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
301
      va_end(ap);
302
0
    }
303
1
  }
prim_add_sse3.c:WLog_Print_dbg_tag
Line
Count
Source
291
1
  {
292
1
    static wLog* log_cached_ptr = nullptr;
293
1
    if (!log_cached_ptr)
294
1
      log_cached_ptr = WLog_Get(tag);
295
296
1
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
297
0
    {
298
0
      va_list ap = WINPR_C_ARRAY_INIT;
299
0
      va_start(ap, fmt);
300
0
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
301
      va_end(ap);
302
0
    }
303
1
  }
prim_alphaComp_sse3.c:WLog_Print_dbg_tag
Line
Count
Source
291
1
  {
292
1
    static wLog* log_cached_ptr = nullptr;
293
1
    if (!log_cached_ptr)
294
1
      log_cached_ptr = WLog_Get(tag);
295
296
1
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
297
0
    {
298
0
      va_list ap = WINPR_C_ARRAY_INIT;
299
0
      va_start(ap, fmt);
300
0
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
301
      va_end(ap);
302
0
    }
303
1
  }
prim_andor_sse3.c:WLog_Print_dbg_tag
Line
Count
Source
291
1
  {
292
1
    static wLog* log_cached_ptr = nullptr;
293
1
    if (!log_cached_ptr)
294
1
      log_cached_ptr = WLog_Get(tag);
295
296
1
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
297
0
    {
298
0
      va_list ap = WINPR_C_ARRAY_INIT;
299
0
      va_start(ap, fmt);
300
0
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
301
      va_end(ap);
302
0
    }
303
1
  }
prim_shift_sse3.c:WLog_Print_dbg_tag
Line
Count
Source
291
1
  {
292
1
    static wLog* log_cached_ptr = nullptr;
293
1
    if (!log_cached_ptr)
294
1
      log_cached_ptr = WLog_Get(tag);
295
296
1
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
297
0
    {
298
0
      va_list ap = WINPR_C_ARRAY_INIT;
299
0
      va_start(ap, fmt);
300
0
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
301
      va_end(ap);
302
0
    }
303
1
  }
prim_sign_ssse3.c:WLog_Print_dbg_tag
Line
Count
Source
291
1
  {
292
1
    static wLog* log_cached_ptr = nullptr;
293
1
    if (!log_cached_ptr)
294
1
      log_cached_ptr = WLog_Get(tag);
295
296
1
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
297
0
    {
298
0
      va_list ap = WINPR_C_ARRAY_INIT;
299
0
      va_start(ap, fmt);
300
0
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
301
      va_end(ap);
302
0
    }
303
1
  }
prim_YCoCg_ssse3.c:WLog_Print_dbg_tag
Line
Count
Source
291
1
  {
292
1
    static wLog* log_cached_ptr = nullptr;
293
1
    if (!log_cached_ptr)
294
1
      log_cached_ptr = WLog_Get(tag);
295
296
1
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
297
0
    {
298
0
      va_list ap = WINPR_C_ARRAY_INIT;
299
0
      va_start(ap, fmt);
300
0
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
301
      va_end(ap);
302
0
    }
303
1
  }
prim_copy_sse4_1.c:WLog_Print_dbg_tag
Line
Count
Source
291
1
  {
292
1
    static wLog* log_cached_ptr = nullptr;
293
1
    if (!log_cached_ptr)
294
1
      log_cached_ptr = WLog_Get(tag);
295
296
1
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
297
0
    {
298
0
      va_list ap = WINPR_C_ARRAY_INIT;
299
0
      va_start(ap, fmt);
300
0
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
301
      va_end(ap);
302
0
    }
303
1
  }
prim_YUV_sse4.1.c:WLog_Print_dbg_tag
Line
Count
Source
291
1
  {
292
1
    static wLog* log_cached_ptr = nullptr;
293
1
    if (!log_cached_ptr)
294
1
      log_cached_ptr = WLog_Get(tag);
295
296
1
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
297
0
    {
298
0
      va_list ap = WINPR_C_ARRAY_INIT;
299
0
      va_start(ap, fmt);
300
0
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
301
      va_end(ap);
302
0
    }
303
1
  }
prim_copy_avx2.c:WLog_Print_dbg_tag
Line
Count
Source
291
1
  {
292
1
    static wLog* log_cached_ptr = nullptr;
293
1
    if (!log_cached_ptr)
294
1
      log_cached_ptr = WLog_Get(tag);
295
296
1
    if (WLog_IsLevelActive(log_cached_ptr, log_level))
297
0
    {
298
0
      va_list ap = WINPR_C_ARRAY_INIT;
299
0
      va_start(ap, fmt);
300
0
      WLog_PrintTextMessageVA(log_cached_ptr, log_level, line, file, fkt, fmt, ap);
301
      va_end(ap);
302
0
    }
303
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
304
305
#define WLog_LVL(tag, lvl, ...) \
306
0
  WLog_Print_dbg_tag(tag, lvl, __LINE__, __FILE__, __func__, __VA_ARGS__)
307
#define WLog_VRB(tag, ...) \
308
29.4k
  WLog_Print_dbg_tag(tag, WLOG_TRACE, __LINE__, __FILE__, __func__, __VA_ARGS__)
309
#define WLog_DBG(tag, ...) \
310
883
  WLog_Print_dbg_tag(tag, WLOG_DEBUG, __LINE__, __FILE__, __func__, __VA_ARGS__)
311
#define WLog_INFO(tag, ...) \
312
  WLog_Print_dbg_tag(tag, WLOG_INFO, __LINE__, __FILE__, __func__, __VA_ARGS__)
313
#define WLog_WARN(tag, ...) \
314
9.26k
  WLog_Print_dbg_tag(tag, WLOG_WARN, __LINE__, __FILE__, __func__, __VA_ARGS__)
315
#define WLog_ERR(tag, ...) \
316
2.83M
  WLog_Print_dbg_tag(tag, WLOG_ERROR, __LINE__, __FILE__, __func__, __VA_ARGS__)
317
#define WLog_FATAL(tag, ...) \
318
0
  WLog_Print_dbg_tag(tag, WLOG_FATAL, __LINE__, __FILE__, __func__, __VA_ARGS__)
319
320
  WINPR_ATTR_NODISCARD
321
  WINPR_API BOOL WLog_SetLogLevel(wLog* log, DWORD logLevel);
322
323
  WINPR_ATTR_NODISCARD
324
  WINPR_API BOOL WLog_SetStringLogLevel(wLog* log, LPCSTR level);
325
326
  WINPR_ATTR_NODISCARD
327
  WINPR_API BOOL WLog_AddStringLogFilters(LPCSTR filter);
328
329
  WINPR_ATTR_NODISCARD
330
  WINPR_API BOOL WLog_SetLogAppenderType(wLog* log, DWORD logAppenderType);
331
332
  WINPR_ATTR_NODISCARD
333
  WINPR_API wLogAppender* WLog_GetLogAppender(wLog* log);
334
335
  WINPR_ATTR_NODISCARD
336
  WINPR_API BOOL WLog_OpenAppender(wLog* log);
337
338
  WINPR_ATTR_NODISCARD
339
  WINPR_API BOOL WLog_CloseAppender(wLog* log);
340
341
  WINPR_ATTR_NODISCARD
342
  WINPR_API BOOL WLog_ConfigureAppender(wLogAppender* appender, const char* setting, void* value);
343
344
  WINPR_ATTR_NODISCARD
345
  WINPR_API wLogLayout* WLog_GetLogLayout(wLog* log);
346
347
  WINPR_ATTR_NODISCARD
348
  WINPR_API BOOL WLog_Layout_SetPrefixFormat(wLog* log, wLogLayout* layout, const char* format);
349
350
#if defined(WITH_WINPR_DEPRECATED)
351
  /** Deprecated */
352
  WINPR_DEPRECATED(WINPR_ATTR_NODISCARD WINPR_API BOOL WLog_Init(void));
353
354
  /** Deprecated */
355
  WINPR_DEPRECATED(WINPR_ATTR_NODISCARD WINPR_API BOOL WLog_Uninit(void));
356
#endif
357
358
  typedef BOOL (*wLogCallbackMessage_t)(const wLogMessage* msg);
359
  typedef BOOL (*wLogCallbackData_t)(const wLogMessage* msg);
360
  typedef BOOL (*wLogCallbackImage_t)(const wLogMessage* msg);
361
  typedef BOOL (*wLogCallbackPackage_t)(const wLogMessage* msg);
362
363
  typedef struct
364
  {
365
    WINPR_ATTR_NODISCARD wLogCallbackData_t data;
366
    WINPR_ATTR_NODISCARD wLogCallbackImage_t image;
367
    WINPR_ATTR_NODISCARD wLogCallbackMessage_t message;
368
    WINPR_ATTR_NODISCARD wLogCallbackPackage_t package;
369
  } wLogCallbacks;
370
371
#ifdef __cplusplus
372
}
373
#endif
374
375
#endif /* WINPR_WLOG_H */