Skip to content

Colored Logging & Improved Backend Logs #255

Merged
its-me-abhishek merged 1 commit intoCCExtractor:mainfrom
ParasKhandelwal1616:fix/Colored-Logging_Improved-Backend-Logs
Dec 9, 2025
Merged

Colored Logging & Improved Backend Logs #255
its-me-abhishek merged 1 commit intoCCExtractor:mainfrom
ParasKhandelwal1616:fix/Colored-Logging_Improved-Backend-Logs

Conversation

@ParasKhandelwal1616
Copy link
Copy Markdown
Contributor

…This PR addresses the current backend logging system, which was unstructured and difficult to read, hindering efficient debugging and monitoring. The solution integrates
github.com/charmbracelet/log to implement structured, leveled, and colored logging.
4
5 Key changes include:
6 - Addition of github.com/charmbracelet/log as a dependency.
7 - Creation of backend/utils/logger.go to centralize logger configuration, allowing for environment variable-driven log levels and automatic colored output.
8 - Replacement of native log and fmt calls with utils.Logger throughout core backend files (main.go, controllers/job_queue.go, controllers/app_handlers.go,
controllers/websocket.go).
9 - Modification of models/logs.go to ensure that in-memory logs for the frontend are also mirrored to the structured console logger for comprehensive visibility.
10
11 This significantly improves log readability, accelerates debugging, and provides a cleaner, more professional log output for development and production environments, with colors
differentiating log levels (e.g., Green for Info, Yellow for Warn, Red for Error).
12
13 - Fixes: #144
14
15 ### Checklist
16
17 - [ ] Ran npx prettier --write . (for formatting)
18 - [ ] Ran gofmt -w . (for Go backend)
19 - [ ] Ran npm test (for JS/TS testing)
20 - [ ] Added unit tests, if applicable
21 - [ ] Verified all tests pass
22 - [ ] Updated documentation, if needed
23
24 ### Additional Notes
25
26 The charmbracelet/log library automatically applies colored output when logging to a terminal that supports ANSI escape codes. This functionality is enabled by default with the curren
integration.

…acelet/log, integrated via log.NewWithOptions(os.Stderr, log.Options{}), automatically provides colored output based on log levels if the terminal supports ANSI.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 8, 2025

Thank you for opening this PR!

Before a maintainer takes a look, it would be really helpful if you could walk through your changes using GitHub's review tools.

Please take a moment to:

  • Check the "Files changed" tab
  • Leave comments on any lines for functions, comments, etc. that are important, non-obvious, or may need attention
  • Clarify decisions you made or areas you might be unsure about and/or any future updates being considered.
  • Finally, submit all the comments!

This helps make the review process smoother and gives us a clearer understanding of your thought process.

Once you've added your self-review, we'll continue from our side. Thank you!

@its-me-abhishek its-me-abhishek merged commit 0ffd79e into CCExtractor:main Dec 9, 2025
5 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.

Colored Logging & Improved Backend Logs

2 participants