Skip to content

Conversation

@Big-Iron-Cheems
Copy link
Collaborator

Type of change

  • Bug fix
  • New feature

Description

Add PacketLogger module.

Related issues

Closes #5686.

How Has This Been Tested?

Singleplayer testing.

Checklist:

  • My code follows the style guidelines of this project.
  • I have added comments to my code in more complex areas.
  • I have tested the code in both development and production environments.

@Big-Iron-Cheems
Copy link
Collaborator Author

The module works as intended, but there's alwasy room for improvement.
If anyone has suggestions to expand this implementation feel free to let me know, send .patch files if possible.

@Big-Iron-Cheems Big-Iron-Cheems marked this pull request as ready for review December 27, 2025 14:15
- Use `Reference2IntOpenHashMap` for `packetCounts`
- Add system to limit log file size and total size to avoid bloating the dir over extended usage
- Add optional chat logging
- Remove unnecessary info prints

TODO: consider a writeLine helper for `fileWriter`
- early return `logPacket` if both outputs are off
- `logSummary` prepares the lines in advance, prints later
- centralized `writeLine` to handle IO ops

Note: summary won't appear if both outputs are off, this makes sense since `packetCounts` would never be updated in that case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Suggestion] packet logger

2 participants