Skip to content

Conversation

@rbtr
Copy link
Collaborator

@rbtr rbtr commented Feb 20, 2025

Fixes a bug in the zapetw core where the extra fields added by calling With were not referenced when producing the log output.

There was a private fields slice in the Core struct, but it is not referenced anywhere. When a new Core is created in With, the fields were copied over...but still not used.
Now, instead, these fields are added to the Encoder. In the With call, the Core is copied and the Encoder cloned, then new fields are added to the clone. This ensures that the new Fields in a derived logger/core do not propogate back up to the root logger...and also that they are used in producing the log output.

Also includes some minor refactoring to fix naming and improve contracts.

Copilot AI review requested due to automatic review settings February 20, 2025 02:54
@rbtr rbtr requested review from a team as code owners February 20, 2025 02:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

@rbtr rbtr self-assigned this Feb 20, 2025
@rbtr rbtr added cns Related to CNS. cni Related to CNI. windows release/latest Change affects latest release train labels Feb 20, 2025
@rbtr
Copy link
Collaborator Author

rbtr commented Feb 20, 2025

/azp run Azure Container Networking PR

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@rbtr rbtr enabled auto-merge February 20, 2025 19:38
@rbtr
Copy link
Collaborator Author

rbtr commented Feb 20, 2025

/azp run Azure Container Networking PR

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@rbtr rbtr added this pull request to the merge queue Feb 20, 2025
@rbtr rbtr mentioned this pull request Feb 20, 2025
Merged via the queue into master with commit ca8da2f Feb 21, 2025
14 checks passed
@rbtr rbtr deleted the fix/zapetw branch February 21, 2025 00:10
@rbtr rbtr mentioned this pull request Feb 21, 2025
sivakami-projects pushed a commit that referenced this pull request Oct 23, 2025
fix: zapetw core with fields

Signed-off-by: Evan Baker <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cni Related to CNI. cns Related to CNS. release/latest Change affects latest release train windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants