PacketConsoleLogger.cpp 974 B

123456789101112131415161718192021222324252627282930313233343536
  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_LogCommandParser==1 && _RAKNET_SUPPORT_PacketLogger==1
  12. #include "PacketConsoleLogger.h"
  13. #include "LogCommandParser.h"
  14. #include <stdio.h>
  15. using namespace RakNet;
  16. PacketConsoleLogger::PacketConsoleLogger()
  17. {
  18. logCommandParser=0;
  19. }
  20. void PacketConsoleLogger::SetLogCommandParser(LogCommandParser *lcp)
  21. {
  22. logCommandParser=lcp;
  23. if (logCommandParser)
  24. logCommandParser->AddChannel("PacketConsoleLogger");
  25. }
  26. void PacketConsoleLogger::WriteLog(const char *str)
  27. {
  28. if (logCommandParser)
  29. logCommandParser->WriteLog("PacketConsoleLogger", str);
  30. }
  31. #endif // _RAKNET_SUPPORT_*
粤ICP备19079148号