Skip to content

feat: Adding slog support and handlers#722

Open
NucleoFusion wants to merge 7 commits intogoharbor:mainfrom
NucleoFusion:feat/slog-refactor
Open

feat: Adding slog support and handlers#722
NucleoFusion wants to merge 7 commits intogoharbor:mainfrom
NucleoFusion:feat/slog-refactor

Conversation

@NucleoFusion
Copy link
Contributor

@NucleoFusion NucleoFusion commented Mar 4, 2026

Adding support for log/slog with flag based checking on output format or verbosity.

image

Changes

  • Added Slog level based logging
    • By Default only WARN and ERROR levels will be shown.
    • On adding the --verbose flag shows INFO and DEBUG level as well.
  • Removed dependency on cobra on handling errors, now logged via slog
  • lipgloss based formatting for levels

EDIT

image

Changes

  • No logs show for non-verbose
  • Modified styles
  • Flag logging in PersistentPreRunE

Added better formatting and color codes

Signed-off-by: NucleoFusion <lakshit.singh.mail@gmail.com>
@codecov
Copy link

codecov bot commented Mar 4, 2026

Codecov Report

❌ Patch coverage is 0% with 70 lines in your changes missing coverage. Please review.
✅ Project coverage is 7.42%. Comparing base (60ad0bd) to head (356aa5f).
⚠️ Report is 111 commits behind head on main.

Files with missing lines Patch % Lines
pkg/logger/handler.go 0.00% 53 Missing ⚠️
pkg/logger/logger.go 0.00% 11 Missing ⚠️
cmd/harbor/root/cmd.go 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             main    #722      +/-   ##
=========================================
- Coverage   10.99%   7.42%   -3.57%     
=========================================
  Files         173     263      +90     
  Lines        8671   13083    +4412     
=========================================
+ Hits          953     972      +19     
- Misses       7612   12002    +4390     
- Partials      106     109       +3     

☔ 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.

Signed-off-by: NucleoFusion <lakshit.singh.mail@gmail.com>
Signed-off-by: NucleoFusion <lakshit.singh.mail@gmail.com>
Signed-off-by: NucleoFusion <lakshit.singh.mail@gmail.com>
Signed-off-by: NucleoFusion <lakshit.singh.mail@gmail.com>
Signed-off-by: NucleoFusion <lakshit.singh.mail@gmail.com>
@NucleoFusion
Copy link
Contributor Author

@bupd Did the stuff we discussed in the meet
Its under the EDIT section in the PR description

Signed-off-by: NucleoFusion <lakshit.singh.mail@gmail.com>
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.

1 participant