#ifndef LOGGING_H_
#define LOGGING_H_

#include <windows.h>
#include <fstream>
#include <iostream>
#include <string>
#include <ctime>
#include <algorithm> 

#define SUFFIX_FOR_LOGGER											TEXT(".csv")

namespace myLogging {

	/**
	* @class Logger
	* @brief Log to the files
	* @author Matej Roman (student of BUT)
	*/
	template <class A, class B>
	class Logger {

		enum class Output {
			info = 0,
			warn = 1
		};

	public:

		Logger() :
			_isLogging(false),
			_febrile(0),
			_total(0)
		{}

		~Logger();

		void CloseLogger()
		{
			if (_isLogging) 
			{
				_lastEntry();
				_file.close();
			}
			if(!_file.is_open()) _isLogging = false;
		}

		bool Init(A path);

		// 0 for info, 1 for warn
		void Logg(int eOut,A str);

		
	private:

		bool _isLogging;

		A _path;

		B _file;

		unsigned int _febrile;
		unsigned int _total;

		bool _CheckDay();

		void _lastEntry();

	};

}

#endif
