logger_fwd.h 794 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. #define log_here { __FILE__, __LINE__, __FUNCTION__ }
  10. namespace logging {
  11. enum class level : int;
  12. struct logpacket;
  13. std::ostream & operator<<(std::ostream & os, level l);
  14. struct location_info {
  15. char const * filename = "???";
  16. int line = 0;
  17. char const * function = "";
  18. };
  19. #if defined( _WIN32 )
  20. constexpr char const * const NEWLINE_TOKEN{"\r\n"};
  21. #else
  22. constexpr char const * const NEWLINE_TOKEN{"\n"};
  23. #endif
  24. }
  25. #define LIST_OF_LOGGING_LEVELS \
  26. X(trace) X(debug) X(info) X(warning) X(error) X(critical) X(fatal) X(none)
  27. #define X(token) token,
  28. namespace logging {
  29. enum class level : int {
  30. LIST_OF_LOGGING_LEVELS warn = warning
  31. };
  32. }
  33. #undef X