FreeRDP
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
proxy_log.h
1
24#ifndef FREERDP_SERVER_PROXY_LOG_H
25#define FREERDP_SERVER_PROXY_LOG_H
26
27#include <winpr/wlog.h>
28#include <freerdp/log.h>
29
30#define PROXY_TAG(tag) FREERDP_TAG("proxy." tag)
31
32/*
33 * log format in proxy is:
34 * "[SessionID=%s]: Log message"
35 * SessionID is optional, but if they should be written to the log,
36 * that's the format.
37 */
38
39/* log macros that prepends session id and function name tp the log message */
40#define PROXY_LOG_INFO(_tag, _context, _format, ...) \
41 WLog_INFO(TAG, "[SessionID=%s]: " _format, \
42 (_context && _context->pdata) ? _context->pdata->session_id : "null", ##__VA_ARGS__)
43#define PROXY_LOG_ERR(_tag, _context, _format, ...) \
44 WLog_ERR(TAG, "[SessionID=%s]: " _format, \
45 (_context && _context->pdata) ? _context->pdata->session_id : "null", ##__VA_ARGS__)
46#define PROXY_LOG_DBG(_tag, _context, _format, ...) \
47 WLog_DBG(TAG, "[SessionID=%s]: " _format, \
48 (_context && _context->pdata) ? _context->pdata->session_id : "null", ##__VA_ARGS__)
49#define PROXY_LOG_WARN(_tag, _context, _format, ...) \
50 WLog_WARN(TAG, "[SessionID=%s]: " _format, \
51 (_context && _context->pdata) ? _context->pdata->session_id : "null", ##__VA_ARGS__)
52
53#endif /* FREERDP_SERVER_PROXY_LOG_H */