logpacket.h 502 B

12345678910111213141516171819202122232425262728
  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. };
  10. struct logpacket {
  11. struct timeval time;
  12. // int thread_id;
  13. level level;
  14. location_info info;
  15. std::string logger;
  16. message message;
  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. }