Logger.hpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-08-20
  6. * Changed: 2020-11-26
  7. *
  8. * */
  9. #ifndef LS_STD_LOGGER_HPP
  10. #define LS_STD_LOGGER_HPP
  11. #include <ls_std/base/Class.hpp>
  12. #include "LogLevel.hpp"
  13. #include <ls_std/io/IWriter.hpp>
  14. #include <ls_std/io/File.hpp>
  15. #include <ls_std/io/FileOutputStream.hpp>
  16. #include <string>
  17. namespace ls_std {
  18. class Logger : public Class {
  19. public:
  20. explicit Logger(const std::shared_ptr<ls_std::IWriter>& _writer);
  21. ~Logger() override = default;
  22. void debug(const ls_std::byte* _data);
  23. void error(const ls_std::byte* _data);
  24. void fatal(const ls_std::byte* _data);
  25. ls_std::LogLevel getLogLevel();
  26. void info(const ls_std::byte* _data);
  27. void setLogLevel(const ls_std::LogLevelValue& _logLevelValue);
  28. void trace(const ls_std::byte* _data);
  29. void warn(const ls_std::byte* _data);
  30. private:
  31. ls_std::LogLevel logLevel {};
  32. std::shared_ptr<ls_std::IWriter> writer {};
  33. void _log(const ls_std::byte* _data, const ls_std::LogLevel& _logLevel);
  34. };
  35. }
  36. #endif