#ifndef _Logger_H_
#define _Logger_H_

#include <sstream>
#include <iostream>
#include <ostream>
#include <string>

class Logger
{
public:
	enum class ELogType
	{
		E_LOG_DEBUG = 0,
		E_LOG_INFO,
		E_LOG_WARN,
		E_LOG_ERROR,
		E_LOG_OFF
	};

public:
	Logger(Logger::ELogType logType, std::string filename, int edit);
	~Logger();
	std::stringstream& Stream() { return oss_; }

private:
	std::stringstream oss_;
	ELogType log_type_;
	std::string filename_;
	int line_;
};

#define XLOGD() Logger(Logger::ELogType::E_LOG_DEBUG, __FILE__, __LINE__).Stream()
#define XLOGI() Logger(Logger::ELogType::E_LOG_INFO, __FILE__, __LINE__).Stream()
#define XLOGW() Logger(Logger::ELogType::E_LOG_WARN, __FILE__, __LINE__).Stream()
#define XLOGE() Logger(Logger::ELogType::E_LOG_ERROR, __FILE__, __LINE__).Stream()

#endif
