* Add ETW support in zap logger for CNI
Added a zap WriteSyncer to enable direct ETW logging through zap core, maintaining existing logging structure while to ETW from CNI.
* Transform 'zapetw' package into a standalone module for external use
* Revert "Transform 'zapetw' package into a standalone module for external use"
This reverts commit 63050ed68d353e43ae1b1fedd11b8e99259b7a28.
* Relocate EtwWriteSyncer.go to zapetw module for improved organization
- Renamed and moved cni/log/ETWZapCore/EtwWriteSyncer.go to zapetw/write_syncer.go.
* Applied gofumpt formatting to adhere to style guidelines.
* 1. Implemented platform-specific ETW logging enhancements.
2. Refactor ETW initialization into dedicated method and zapetw package.
* Changed InitETWLogger method signature for Linux.
* Wrapped error messages at each level of the call hierarchy.
* Removed punctuation marks from error messages.
* Wrapped error messages with errors.wrap method.
* Added comments for clarity.
* implemented zap.core for ETW.
* Fixed lint issues.
* Catch errors from etw.writeEvent method.
* Renamed provider.
* Abstracted etw core creation in logger_windows.
Removed unsupported error from logger_linux to keep the behaviour uniform.
* renamed unused parameter.
* Renamed variable to lower camel case as it is private. Removed additional local reference.
* fixed variable name.
* Added comment.
* Renamed ETW provider, removed application names from the provider name.
---------
Co-authored-by: Sivakami Subramaniam <t-sivakamis@microsoft.com>
* feat: added logger package and replaced old log initialization for the new one
* feat: changed all log lines to new zap logger
* fix: typo
* Update azure-ipam/logger/logger.go
Co-authored-by: Timothy J. Raymond <timraymond@users.noreply.github.com>
* fix: adding constants to describe logger rotations constraints
* Renamed logger New method
* Replaced logAndSend method by log 1st and send then so we can use zap fields
* minor fixes
* added logger init for tests
* replaced Any by Error
* gci ipam_test
* fixed govet errors
* moved component to a zap field
* fixed linit issues
* added log mock
* fix: gci
* fix: added context for logger teardown
* Update cni/log/logger.go
Co-authored-by: Evan Baker <rbtr@users.noreply.github.com>
* moved logger init mock function
* fix: lint findings
---------
Co-authored-by: Esteban Capillo <estebancams@microsoft.com>
Co-authored-by: Timothy J. Raymond <timraymond@users.noreply.github.com>
Co-authored-by: Evan Baker <rbtr@users.noreply.github.com>