LogCodeEntity.cs 529 B

12345678910111213141516171819202122
  1. using XGame.Framework.Json;
  2. using System;
  3. namespace XGame.Framework.Logger
  4. {
  5. internal struct LogCodeEntity
  6. {
  7. public string client_time;
  8. public string log_level;
  9. public string log_info;
  10. public string ToConsoleString()
  11. {
  12. return $"[{log_level}]{log_info}";
  13. }
  14. public string ToWriteString()
  15. {
  16. client_time = DateTime.UtcNow.AddHours(8).ToString("yyyy-MM-ddTHH:mm:ss.fffzzzz");
  17. return XJson.ToJson(this);
  18. }
  19. }
  20. }