logger_fwd.h 739 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. //
  2. // logger_fwd.hpp
  3. // logger
  4. //
  5. // Created by Sam Jaffe on 9/3/16.
  6. //
  7. #pragma once
  8. #include <string>
  9. namespace logging {
  10. enum class level : int;
  11. struct logpacket;
  12. std::ostream & operator<<(std::ostream & os, level l);
  13. struct location_info {
  14. char const * filename = "???";
  15. int line = 0;
  16. char const * function = "";
  17. };
  18. #if defined( _WIN32 )
  19. constexpr char const * const NEWLINE_TOKEN{"\r\n"};
  20. #else
  21. constexpr char const * const NEWLINE_TOKEN{"\n"};
  22. #endif
  23. }
  24. #define LIST_OF_LOGGING_LEVELS \
  25. X(trace) X(debug) X(info) X(warning) X(error) X(critical) X(fatal) X(none)
  26. #define X(token) token,
  27. namespace logging {
  28. enum class level : int {
  29. LIST_OF_LOGGING_LEVELS warn = warning
  30. };
  31. }
  32. #undef X