logpacket.h 535 B

1234567891011121314151617181920212223242526272829
  1. #pragma once
  2. #include "level.h"
  3. #include "message.h"
  4. namespace logging {
  5. struct location_info {
  6. char const * filename = "???";
  7. int line = 0;
  8. char const * function = "";
  9. char const * pretty_function = "";
  10. };
  11. struct logpacket {
  12. struct timeval time;
  13. // int thread_id;
  14. level level;
  15. location_info info;
  16. std::string logger;
  17. message message;
  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. }