PacketFileLogger.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. /// \file
  11. /// \brief This will write all incoming and outgoing network messages to a file
  12. ///
  13. #include "NativeFeatureIncludes.h"
  14. #if _RAKNET_SUPPORT_PacketLogger==1
  15. #ifndef __PACKET_FILE_LOGGER_H_
  16. #define __PACKET_FILE_LOGGER_H_
  17. #include "PacketLogger.h"
  18. #include <stdio.h>
  19. namespace RakNet
  20. {
  21. /// \ingroup PACKETLOGGER_GROUP
  22. /// \brief Packetlogger that outputs to a file
  23. class RAK_DLL_EXPORT PacketFileLogger : public PacketLogger
  24. {
  25. public:
  26. PacketFileLogger();
  27. virtual ~PacketFileLogger();
  28. void StartLog(const char *filenamePrefix);
  29. virtual void WriteLog(const char *str);
  30. protected:
  31. FILE *packetLogFile;
  32. };
  33. } // namespace RakNet
  34. #endif
  35. #endif // _RAKNET_SUPPORT_*
粤ICP备19079148号