logger_fwd.h 967 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. struct properties;
  14. // Implementation classes
  15. class appender;
  16. class layout;
  17. using p_appender = std::shared_ptr<appender>;
  18. using p_layout = std::shared_ptr<layout>;
  19. std::ostream & operator<<(std::ostream & os, level l);
  20. struct location_info {
  21. char const * filename = "???";
  22. int line = 0;
  23. char const * function = "";
  24. };
  25. #if defined( _WIN32 )
  26. constexpr char const * const NEWLINE_TOKEN{"\r\n"};
  27. #else
  28. constexpr char const * const NEWLINE_TOKEN{"\n"};
  29. #endif
  30. }
  31. #define LIST_OF_LOGGING_LEVELS \
  32. X(trace) X(debug) X(info) X(warning) X(error) X(critical) X(fatal) X(none)
  33. #define X(token) token,
  34. namespace logging {
  35. enum class level : int {
  36. LIST_OF_LOGGING_LEVELS warn = warning
  37. };
  38. }
  39. #undef X