FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat: Netcode log system by EmandM · Pull Request #3944 · Unity-Technologies/com.unity.netcode.gameobjects · GitHub

feat: Netcode log system - #3944

Merged
EmandM merged 19 commits into
develop-2.0.0from
experimental/logger
Apr 24, 2026
Merged

feat: Netcode log system#3944
EmandM merged 19 commits into
develop-2.0.0from
experimental/logger

Conversation

EmandM commented Apr 17, 2026
edited
Loading

Copy link
Copy Markdown
Member

Purpose of this PR

  • Adds a ContextualLogger class that can hold references to a NetworkManager and a GameObject
  • Adds a ILogContext interface to standardize how LogContexts can be written to a builder
  • Adds a Context struct that is passed to the functions on the ContextualLogger to collect information about specific callsites
  • Uses these new structs throughout NetworkManager, NetworkManagerHelper, and NetworkManagerEditor.
  • Swaps out NetworkLog to use a system wide static version of the ContextualLogger
  • The new logger will highlight the relevant GameObject in the scene view when clicking on logs!

Jira ticket

Changelog

  • Added: Context aware logging

Documentation

  • No documentation changes or additions were necessary.

Testing & QA (How your changes can be verified during release Playtest)

Functional Testing

Manual testing :

  • Manual testing done

Automated tests:

  • Covered by existing automated tests
  • Covered by new automated tests

Does the change require QA team to:

  • Review automated tests?
  • Execute manual tests?
  • Provide feedback about the PR?

If any boxes above are checked the QA team will be automatically added as a PR reviewer.

Backports

}
}

private void WatchForSingleton()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

What happens here if someone changes scenes and creates a new NetworkManager rather than reusing the previous one (like, say, if they're switching from a lobby to an instanced game so they're changing to a new session)? Or if multiple NetworkManagers exist at once as in our tests?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I also listen to the NetworkManager.OnDestroy. If the singleton manager is destroyed, it will set the internal manager to null and then re-subscribe to the NetworkManager.OnSingletonReady to wait for a new one to come in.

EmandM marked this pull request as ready for review April 23, 2026 18:09
EmandM requested a review from a team as a code owner April 23, 2026 18:09

NoelStephensUnity left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Looks good!
👍

EmandM enabled auto-merge (squash) April 24, 2026 18:28
EmandM merged commit 77aef75 into develop-2.0.0 Apr 24, 2026
23 checks passed
EmandM deleted the experimental/logger branch April 24, 2026 22:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

3 participants


Back | FazBrowse Home | New Git URL