PacketOutputWindowLogger.cpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright (c) 2014, Oculus VR, Inc.
  3. * All rights reserved.
  4. *
  5. * This source code is licensed under the BSD-style license found in the
  6. * LICENSE file in the root directory of this source tree. An additional grant
  7. * of patent rights can be found in the PATENTS file in the same directory.
  8. *
  9. */
  10. #include "NativeFeatureIncludes.h"
  11. #if _RAKNET_SUPPORT_PacketLogger==1
  12. #if defined(UNICODE)
  13. #include "RakWString.h"
  14. #endif
  15. #include "PacketOutputWindowLogger.h"
  16. #include "RakString.h"
  17. #if defined(_WIN32)
  18. #include "WindowsIncludes.h"
  19. #endif
  20. using namespace RakNet;
  21. PacketOutputWindowLogger::PacketOutputWindowLogger()
  22. {
  23. }
  24. PacketOutputWindowLogger::~PacketOutputWindowLogger()
  25. {
  26. }
  27. void PacketOutputWindowLogger::WriteLog(const char *str)
  28. {
  29. #if defined(_WIN32)
  30. #if defined(UNICODE)
  31. RakNet::RakWString str2 = str;
  32. str2+="\n";
  33. OutputDebugString(str2.C_String());
  34. #else
  35. RakNet::RakString str2 = str;
  36. str2+="\n";
  37. OutputDebugString(str2.C_String());
  38. #endif
  39. // DS_APR
  40. #elif defined(__native_client__)
  41. fprintf(stderr, "%s\n", str);
  42. // /DS_APR
  43. #endif
  44. }
  45. #endif // _RAKNET_SUPPORT_*
粤ICP备19079148号