Blame server/proxy/pf_log.h

Packit Service fa4841
/**
Packit Service fa4841
 * FreeRDP: A Remote Desktop Protocol Implementation
Packit Service fa4841
 * FreeRDP Proxy Server
Packit Service fa4841
 *
Packit Service fa4841
 * Copyright 2019 Mati Shabtay <matishabtay@gmail.com>
Packit Service fa4841
 * Copyright 2019 Kobi Mizrachi <kmizrachi18@gmail.com>
Packit Service fa4841
 * Copyright 2019 Idan Freiberg <speidy@gmail.com>
Packit Service fa4841
 *
Packit Service fa4841
 * Licensed under the Apache License, Version 2.0 (the "License");
Packit Service fa4841
 * you may not use this file except in compliance with the License.
Packit Service fa4841
 * You may obtain a copy of the License at
Packit Service fa4841
 *
Packit Service fa4841
 *     http://www.apache.org/licenses/LICENSE-2.0
Packit Service fa4841
 *
Packit Service fa4841
 * Unless required by applicable law or agreed to in writing, software
Packit Service fa4841
 * distributed under the License is distributed on an "AS IS" BASIS,
Packit Service fa4841
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Packit Service fa4841
 * See the License for the specific language governing permissions and
Packit Service fa4841
 * limitations under the License.
Packit Service fa4841
 */
Packit Service fa4841
Packit Service fa4841
#ifndef FREERDP_SERVER_PROXY_PFLOG_H
Packit Service fa4841
#define FREERDP_SERVER_PROXY_PFLOG_H
Packit Service fa4841
Packit Service fa4841
#include <winpr/wlog.h>
Packit Service fa4841
Packit Service fa4841
#define PROXY_TAG(tag) "proxy." tag
Packit Service fa4841
Packit Service fa4841
/*
Packit Service fa4841
 * log format in proxy is:
Packit Service fa4841
 * "[SessionID=%s] - [__FUNCTION__]: Log message"
Packit Service fa4841
 * both SessionID and __FUNCTION__ are optional, but if they should be written to the log,
Packit Service fa4841
 * that's the format.
Packit Service fa4841
 */
Packit Service fa4841
Packit Service fa4841
/* log macros that prepends session id and function name tp the log message */
Packit Service fa4841
#define LOG_INFO(_tag, _context, _format, ...)                                                \
Packit Service fa4841
	WLog_INFO(TAG, "[SessionID=%s][%s]: " _format, _context->pdata->session_id, __FUNCTION__, \
Packit Service fa4841
	          ##__VA_ARGS__)
Packit Service fa4841
#define LOG_ERR(_tag, _context, _format, ...)                                                \
Packit Service fa4841
	WLog_ERR(TAG, "[SessionID=%s][%s]: " _format, _context->pdata->session_id, __FUNCTION__, \
Packit Service fa4841
	         ##__VA_ARGS__)
Packit Service fa4841
#define LOG_DBG(_tag, _context, _format, ...)                                                \
Packit Service fa4841
	WLog_DBG(TAG, "[SessionID=%s][%s]: " _format, _context->pdata->session_id, __FUNCTION__, \
Packit Service fa4841
	         ##__VA_ARGS__)
Packit Service fa4841
#define LOG_WARN(_tag, _context, _format, ...)                                                \
Packit Service fa4841
	WLog_WARN(TAG, "[SessionID=%s][%s]: " _format, _context->pdata->session_id, __FUNCTION__, \
Packit Service fa4841
	          ##__VA_ARGS__)
Packit Service fa4841
Packit Service fa4841
#endif /* FREERDP_SERVER_PROXY_PFLOG_H */