AlpacaLibary  1.63
A closed source C++ bot for OSRS
Logger.hpp
Go to the documentation of this file.
1 #ifndef LOGGER_HPP_INCLUDED
2 #define LOGGER_HPP_INCLUDED
3 
4 #include <iostream>
5 #include <string>
6 
7 class Logger : public std::ostream, public std::streambuf
8 {
9  public:
10  Logger(const std::string& Prefix, bool Enabled = true);
11  Logger(std::string (*Func)(), bool Enabled = true);
12  void SetEnabled(bool Toggle);
13  bool IsEnabled() const;
18  virtual std::streambuf::int_type overflow(std::streambuf::int_type Char = std::streambuf::traits_type::eof());
20  private:
21  std::string Prefix = "";
22  std::string (*FuncPtr)() = nullptr;
23  bool Enabled;
24  std::uint32_t TabCount;
25  bool MinusAtEndOfNewLine = false;
26  bool AddAtEndOfNewLine = false;
27  bool NewLine = true;
28 };
29 
30 #endif // LOGGER_HPP_INCLUDED
Definition: Logger.hpp:8
Logger(const std::string &Prefix, bool Enabled=true)
Logger & operator++()
Logger & operator--()
Logger & operator++(int)
Logger(std::string(*Func)(), bool Enabled=true)
bool IsEnabled() const
Logger & operator--(int)
void SetEnabled(bool Toggle)
virtual std::streambuf::int_type overflow(std::streambuf::int_type Char=std::streambuf::traits_type::eof())