#include <Arduino.h>

namespace detail
{
	class DebugLog : public Print
	{
	public:
		DebugLog();
		~DebugLog();

		virtual size_t write(uint8_t b) override;
		virtual size_t write(const uint8_t *buffer, size_t size) override;

		const char* get(int partIdx);

	private:
		void append(uint8_t b);

	private:
		uint8_t buffer[4096];
		int start = 0;
		int end = 0;
	};
}

extern detail::DebugLog DebugLog;
