Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update logger.ts #805

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

aniruddhaadak80
Copy link

@aniruddhaadak80 aniruddhaadak80 commented Oct 30, 2024

Changes Made:

  1. Simplified the colorize function by directly using the colors object to get the color function, reducing the repetitive code for setting the timestamp.

  2. Added a check in colorize to ensure that only valid levels are colorized, defaulting to the level name if not found.


Important

Simplified colorize function in logger.ts and added validation for log levels to ensure only valid levels are colorized.

  • Functionality:
    • Simplified colorize function in logger.ts by using the colors object directly to fetch color functions, reducing repetitive code.
    • Added validation in colorize to ensure only valid log levels are colorized, defaulting to the level name if not found.

This description was created by Ellipsis for 362797d. It will automatically update as commits are pushed.

Changes Made:

1. Simplified the colorize function by directly using the colors object to get the color function, reducing the repetitive code for setting the timestamp.

2. Added a check in colorize to ensure that only valid levels are colorized, defaulting to the level name if not found.
Copy link

vercel bot commented Oct 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
composio ❌ Failed (Inspect) Oct 30, 2024 1:41pm

Copy link

sweep-ai bot commented Oct 30, 2024

Hey @aniruddhaadak80, here is an example of how you can ask me to improve this pull request:

@Sweep Add unit tests for the `colorize` function to verify:
1. It correctly applies colors for valid log levels (error, warn, info, debug)
2. It returns the original level name when an invalid level is provided
3. It consistently applies gray color to timestamps regardless of log level

📖 For more information on how to use Sweep, please read our documentation.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Reviewed everything up to 362797d in 26 seconds

More details
  • Looked at 51 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_IhjJMkWG5HE03tst


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

js/src/utils/logger.ts Outdated Show resolved Hide resolved
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
@aniruddhaadak80
Copy link
Author

Please review and add hacktoberfest label after review successfully approved . Thank you .

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