logger_fwd.h 688 B

123456789101112131415161718192021222324252627282930313233343536
  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. #define LIST_OF_LOGGING_LEVELS \
  11. X(trace) X(debug) X(info) X(warning) X(error) X(critical) X(fatal) X(none)
  12. #define X(token) token,
  13. enum class level : int {
  14. LIST_OF_LOGGING_LEVELS warn = warning
  15. };
  16. #undef X
  17. std::ostream & operator<<(std::ostream & os, level l);
  18. struct location_info {
  19. char const * filename = "???";
  20. int line = 0;
  21. char const * function = "";
  22. };
  23. struct logpacket {
  24. struct timeval time;
  25. // int thread_id;
  26. level level;
  27. location_info info;
  28. std::string logger;
  29. std::string message;
  30. };
  31. }