xref: /haiku/src/tests/kits/net/netservices2/HttpDebugLogger.h (revision 52c4471a3024d2eb81fe88e2c3982b9f8daa5e56)
1 /*
2  * Copyright 2021 Haiku, inc.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef HTTP_DEBUG_LOGGER_H
6 #define HTTP_DEBUG_LOGGER_H
7 
8 #include <File.h>
9 #include <Looper.h>
10 
11 
12 class HttpDebugLogger : public BLooper
13 {
14 public:
15 								HttpDebugLogger();
16 			void				SetConsoleLogging(bool enabled = true);
17 			void				SetFileLogging(const char* path);
18 
19 protected:
20 	virtual	void				MessageReceived(BMessage* message) override;
21 
22 private:
23 			bool				fConsoleLogging = false;
24 			BFile				fLogFile;
25 };
26 
27 #endif // HTTP_DEBUG_LOGGER_H
28