RestLink 2.2.0
Powerfull Rest Client for Qt
Loading...
Searching...
No Matches
abstractrequestinterceptor.h
1#ifndef RESTLINK_ABSTRACTREQUESTINTERCEPTOR_H
2#define RESTLINK_ABSTRACTREQUESTINTERCEPTOR_H
3
4#include <QtCore/qloggingcategory.h>
5
6#include <RestLink/global.h>
7#include <RestLink/abstractrequesthandler.h>
8
9namespace RestLink {
10
11class RESTLINK_EXPORT AbstractRequestInterceptor
12{
13public:
14 virtual ~AbstractRequestInterceptor() = default;
15
16 virtual void intercept(AbstractRequestHandler::Method method, Request &request, Body &body) = 0;
17};
18
20{
21public:
22 LogRequestInterceptor(const char *category, QtMsgType enableForLevel = QtDebugMsg);
23 LogRequestInterceptor(QLoggingCategory *category);
25
26 void intercept(AbstractRequestHandler::Method method, Request &request, Body &body) override;
27
28private:
29 QLoggingCategory *m_category;
30 bool m_deleteCategory;
31};
32
33}
34
35#endif // RESTLINK_ABSTRACTREQUESTINTERCEPTOR_H