Skip to content

Conversation

Alanxtl
Copy link
Contributor

@Alanxtl Alanxtl commented Sep 24, 2025

  • fix logger config overwrite problem
  • add test file for logger/controller

@codecov-commenter
Copy link

codecov-commenter commented Sep 24, 2025

Codecov Report

❌ Patch coverage is 86.56716% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 16.20%. Comparing base (26606a8) to head (a243011).
⚠️ Report is 71 commits behind head on develop.

Files with missing lines Patch % Lines
pkg/cmd/gateway.go 0.00% 6 Missing ⚠️
pkg/logger/logger.go 94.73% 2 Missing and 1 partial ⚠️

❗ There is a different number of reports uploaded between BASE (26606a8) and HEAD (a243011). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (26606a8) HEAD (a243011)
1 0
Additional details and impacted files
@@             Coverage Diff              @@
##           develop     #765       +/-   ##
============================================
- Coverage    54.67%   16.20%   -38.47%     
============================================
  Files          671      220      -451     
  Lines        78658    16430    -62228     
============================================
- Hits         43006     2663    -40343     
+ Misses       31981    13530    -18451     
+ Partials      3671      237     -3434     
Flag Coverage Δ
unittests 16.20% <86.56%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@AlexStocks AlexStocks requested a review from Copilot October 1, 2025 14:39
Copy link
Contributor

@Copilot 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.

Pull Request Overview

This pull request fixes a logger configuration overwrite problem and adds comprehensive test coverage for the logger module. The main issue was that changing log levels at runtime would incorrectly rebuild the entire logger instead of just updating the level atomically.

  • Fixed SetLoggerLevel to use atomic level updates instead of rebuilding the logger
  • Added comprehensive test coverage for logger functionality and controller behavior
  • Improved code organization and documentation for better maintainability

Reviewed Changes

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

File Description
pkg/logger/logger_test.go Complete rewrite with new comprehensive tests for stacktrace control, level changes, hot reload, and caller encoding
pkg/logger/logger.go Refactored initialization logic with better error handling and unified build options
pkg/logger/controller_test.go New test file covering controller functionality including level parsing and basic usage
pkg/logger/controller.go Fixed SetLoggerLevel to use atomic updates and improved parseLevel function

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link

sonarqubecloud bot commented Oct 7, 2025

@baerwang baerwang merged commit f472c94 into apache:develop Oct 8, 2025
10 checks passed
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.

4 participants