#ifndef LOGGER_HPP_INCLUDED
#define LOGGER_HPP_INCLUDED

#include <iostream>
#include <string>

/** @addtogroup Types
* @{ */
class Logger : public std::ostream, public std::streambuf
{
    public:
        /**
		* @brief Constructs a Logger, with a Prefix
		* @param std::string Prefix     The Prefix that's added before a message
		* @param bool Enabled       Enabled the printing of output sent to the logger, if false no output will be printed
		* @par Detailed Description
		* Loggers can be used to make it easier to identify whats what in the Log.
		* We urge you to instead use our default Loggers, for sake of consistency, however we will not keep you from using the Logger class.
		* You will need to add whitespace to the end of a Prefix, if you want to space out the Prefix and the Message.
		* @par Example
		* @code
		*   Logger LevelUp("[LEVEL] Gained a Level Up in the Skill");
		*   LevelUp << "Mining" << std::endl;
		* @endcode
		*/
        Logger(const std::string& Prefix, bool Enabled = true);
        /**
		* @brief Constructs a Logger, with a function pointer that returns a String
		* @param std::string (*Func)() Prefix     The Prefix that's added before a message
		* @param bool Enabled       Enabled the printing of output sent to the logger, if false no output will be printed
		*/
        Logger(std::string (*Func)(), bool Enabled = true);
        /**
		* @brief Sets the Enabled state of a logger
		* @par Description
		* Toggles the state of Enabled in a logger
		*/
        void SetEnabled(bool Toggle);
        /**
		* @brief Returns True if the Logger is Enabled
		* @return True if the Logger is Enabled
		*/
        bool IsEnabled() const;
        virtual std::streambuf::int_type overflow(std::streambuf::int_type Char = std::streambuf::traits_type::eof());
        ~Logger();
    private:
        std::string Prefix = "";
        std::string (*FuncPtr)() = nullptr;
        bool Enabled;
        bool NewLine = true;
};

/** @} */

#endif // LOGGER_HPP_INCLUDED
