#include <thread>
#include <iostream>

#include "common.h"

using namespace std::literals;

int main()
{
	namespace CH = std::chrono;

	auto logf = LogFile();
	refstream stream = std::ref(std::cout);

	while(1) {
		logf.change(stream);
		auto epoch = CH::duration_cast<CH::seconds>(
		                 CH::system_clock::now().time_since_epoch()
		             ).count();

		stream.get() << "begin\t" << epoch << std::endl;
		stream.get() << dumpReport();
		stream.get() << "end\t" << epoch << std::endl;

		std::this_thread::sleep_for(1min);
	}
	return 0;
}
