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

feat: add custom LogService with Winston for error logging #3406

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

Conversation

YashGupt29
Copy link

@YashGupt29 YashGupt29 commented Nov 18, 2024

Title:

Issue is #3358 Implement Custom LogService Using Winston for Enhanced Error Logging as suggest by the PR #3265

Description:

As per the discussion in PR #3265 and the request from @akshatnema, this PR implements a custom logging service using Winston to improve error logging throughout the application.

Key changes include:

Configured Winston with custom formatting to include timestamps, log levels, and colorization for better readability.
Introduced multiple transports for logging: console and file-based logs (error.log for errors and combined.log for general logs).
Enhanced log output with additional context, including tool names, URLs, and stack traces, where applicable.
Improved error tracking and visibility in the application.
This implementation ensures that error logs are captured consistently across the application, facilitating easier debugging and issue resolution.

Summary by CodeRabbit

  • New Features

    • Introduced a logging utility for improved error reporting and message clarity.
  • Bug Fixes

    • Enhanced error handling in the tools processing to provide structured logging instead of console error messages.
  • Chores

    • Updated dependencies to include logging capabilities through Winston and removed an unused dependency.

Copy link

coderabbitai bot commented Nov 18, 2024

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This pull request introduces a new logging utility in the project by adding a logger.js file that utilizes the winston library. It modifies the package.json to include winston and winston-timestamp-colorize as dependencies while retaining fast-xml-parser in devDependencies. Additionally, the scripts/tools/tools-object.js file is updated to replace console error messages with structured logging calls using the new logger, enhancing error reporting during tool processing.

Changes

File Change Summary
logger.js Introduced a logging utility using winston, configured to log at 'info' level to console and files.
package.json Added dependencies: "winston": "^3.17.0" and "winston-timestamp-colorize": "^1.1.0"; removed "fast-xml-parser": "^4.5.0" from dependencies.
scripts/tools/tools-object.js Replaced console error messages in convertTools function with structured logging using the new logger.

Possibly related issues

Poem

🐰 In the burrow where logs now bloom,
A logger's song dispels the gloom.
With Winston's might, errors take flight,
Colorful timestamps shine so bright.
From tools we glean, with clarity seen,
A tale of logs, in every scene! 🌼


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

Copy link

netlify bot commented Nov 18, 2024

Deploy Preview for asyncapi-website ready!

Name Link
🔨 Latest commit 4d1706a
🔍 Latest deploy log https://app.netlify.com/sites/asyncapi-website/deploys/67418863a632640008a26283
😎 Deploy Preview https://deploy-preview-3406--asyncapi-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@asyncapi-bot
Copy link
Contributor

asyncapi-bot commented Nov 18, 2024

⚡️ Lighthouse report for the changes in this PR:

Category Score
🔴 Performance 38
🟢 Accessibility 98
🟢 Best practices 92
🟢 SEO 100
🔴 PWA 33

Lighthouse ran on https://deploy-preview-3406--asyncapi-website.netlify.app/

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Outside diff range and nitpick comments (3)
logger.js (1)

26-36: Consider adding log rotation and configurable paths

The logger configuration looks good overall, but there are some important considerations:

  1. Add log rotation to prevent logs from growing indefinitely:
const { createLogger, format, transports } = require('winston');
require('winston-daily-rotate-file');

// Add this transport instead of current File transport
new transports.DailyRotateFile({
  filename: 'logs/error-%DATE%.log',
  datePattern: 'YYYY-MM-DD',
  level: 'error',
  maxSize: '20m',
  maxFiles: '14d'
})
  1. Consider making log paths configurable through environment variables or configuration file
  2. Add directory creation/verification before initializing file transports

Would you like me to provide a complete implementation addressing these points?

🧰 Tools
🪛 eslint

[error] 31-31: Delete ··

(prettier/prettier)


[error] 34-34: Delete ,

(prettier/prettier)


[error] 35-35: Delete ,

(prettier/prettier)

scripts/tools/tools-object.js (2)

11-11: LGTM! Minor style suggestion.

The logger import is correctly placed with other dependencies.

Consider using single quotes for consistency with other imports:

-const logger = require("../../logger");
+const logger = require('../../logger');
🧰 Tools
🪛 eslint

[error] 11-12: Replace "../../logger");⏎ with '../../logger');

(prettier/prettier)


115-121: Consider error handling strategy.

The current implementation logs the error and then throws it, which could lead to duplicate logging if caught by upper layers.

Consider either:

  1. Just logging without throwing:
-      // console.error(err)
       logger.error('Error processing tool', {
         message: err.message,
         stack: err.stack,
         tool_name: tool?.name,
         url: tool?.url
-      });     
-      throw err;
+      });
  1. Or just throwing without logging here, and handling all logging in a top-level error handler:
-      // console.error(err)
-      logger.error('Error processing tool', {
-        message: err.message,
-        stack: err.stack,
-        tool_name: tool?.name,
-        url: tool?.url
-      });     
       throw err;
🧰 Tools
🪛 eslint

[error] 116-116: Delete ··

(prettier/prettier)


[error] 117-117: Delete ··

(prettier/prettier)


[error] 118-118: Delete ··

(prettier/prettier)


[error] 119-119: Delete ··

(prettier/prettier)


[error] 120-120: Delete ··

(prettier/prettier)


[error] 121-121: Replace ··});····· with });

(prettier/prettier)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between b6b0573 and f3fa8e8.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • logger.js (1 hunks)
  • package.json (2 hunks)
  • scripts/tools/tools-object.js (2 hunks)
🧰 Additional context used
🪛 eslint
logger.js

[error] 5-5: Delete ·

(prettier/prettier)


[error] 6-6: Delete ·

(prettier/prettier)


[error] 7-7: Replace all:true}),· with ·all:·true·}),

(prettier/prettier)


[error] 8-8: Identifier 'tool_name' is not in camel case.

(camelcase)


[error] 8-9: Delete ⏎··

(prettier/prettier)


[error] 12-12: Delete ··

(prettier/prettier)


[error] 12-12: Identifier 'tool_name' is not in camel case.

(camelcase)


[error] 13-13: Delete ··

(prettier/prettier)


[error] 13-13: Identifier 'tool_name' is not in camel case.

(camelcase)


[error] 14-14: Delete ··

(prettier/prettier)


[error] 15-15: Delete ··

(prettier/prettier)


[error] 16-16: Replace ········ with ······

(prettier/prettier)


[error] 17-17: Delete ··

(prettier/prettier)


[error] 18-18: Delete ··

(prettier/prettier)


[error] 19-19: Delete ··

(prettier/prettier)


[error] 20-20: Delete ··

(prettier/prettier)


[error] 21-21: Delete ··

(prettier/prettier)


[error] 22-23: Delete ,⏎

(prettier/prettier)


[error] 31-31: Delete ··

(prettier/prettier)


[error] 34-34: Delete ,

(prettier/prettier)


[error] 35-35: Delete ,

(prettier/prettier)

scripts/tools/tools-object.js

[error] 11-12: Replace "../../logger");⏎ with '../../logger');

(prettier/prettier)


[error] 104-104: Delete ··········

(prettier/prettier)


[error] 105-105: Expected exception block, space or tab after '//' in comment.

(spaced-comment)


[error] 105-105: Delete ·

(prettier/prettier)


[error] 106-106: Replace ············ with ··········

(prettier/prettier)


[error] 107-107: Delete ··

(prettier/prettier)


[error] 107-107: 'err' is not defined.

(no-undef)


[error] 108-108: Replace ·············· with ············

(prettier/prettier)


[error] 108-108: 'err' is not defined.

(no-undef)


[error] 109-109: Delete ··

(prettier/prettier)


[error] 110-110: Delete ··

(prettier/prettier)


[error] 111-111: Replace ············});·········· with ··········});

(prettier/prettier)


[error] 116-116: Delete ··

(prettier/prettier)


[error] 117-117: Delete ··

(prettier/prettier)


[error] 118-118: Delete ··

(prettier/prettier)


[error] 119-119: Delete ··

(prettier/prettier)


[error] 120-120: Delete ··

(prettier/prettier)


[error] 121-121: Replace ··});····· with });

(prettier/prettier)

🔇 Additional comments (7)
logger.js (3)

38-38: LGTM!

The module export is clean and follows standard Node.js practices.


1-38: Verify logging implementation completeness

Let's ensure this implementation aligns with the codebase:

#!/bin/bash
# Description: Check for existing logging implementations and verify usage

# Check for any existing logging utilities
echo "Checking for existing logging implementations..."
rg -l "createLogger|winston" --type js

# Verify proper usage in tools-object.js
echo "Verifying logger usage in tools-object.js..."
rg "console\.(log|error|warn)" scripts/tools/tools-object.js
🧰 Tools
🪛 eslint

[error] 5-5: Delete ·

(prettier/prettier)


[error] 6-6: Delete ·

(prettier/prettier)


[error] 7-7: Replace all:true}),· with ·all:·true·}),

(prettier/prettier)


[error] 8-8: Identifier 'tool_name' is not in camel case.

(camelcase)


[error] 8-9: Delete ⏎··

(prettier/prettier)


[error] 12-12: Delete ··

(prettier/prettier)


[error] 12-12: Identifier 'tool_name' is not in camel case.

(camelcase)


[error] 13-13: Delete ··

(prettier/prettier)


[error] 13-13: Identifier 'tool_name' is not in camel case.

(camelcase)


[error] 14-14: Delete ··

(prettier/prettier)


[error] 15-15: Delete ··

(prettier/prettier)


[error] 16-16: Replace ········ with ······

(prettier/prettier)


[error] 17-17: Delete ··

(prettier/prettier)


[error] 18-18: Delete ··

(prettier/prettier)


[error] 19-19: Delete ··

(prettier/prettier)


[error] 20-20: Delete ··

(prettier/prettier)


[error] 21-21: Delete ··

(prettier/prettier)


[error] 22-23: Delete ,⏎

(prettier/prettier)


[error] 31-31: Delete ··

(prettier/prettier)


[error] 34-34: Delete ,

(prettier/prettier)


[error] 35-35: Delete ,

(prettier/prettier)


1-2: Verify package.json dependencies

The imports look correct. Let's verify the dependencies are properly configured in package.json.

✅ Verification successful

Dependencies are properly configured

Both winston (v3.17.0) and winston-timestamp-colorize (v1.1.0) are correctly listed in the package.json dependencies section. The imports in logger.js are properly supported by the project configuration.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if winston dependencies are properly configured in package.json
# Expected: Both winston and winston-timestamp-colorize should be listed in dependencies

jq '.dependencies | has("winston") and has("winston-timestamp-colorize")' package.json

Length of output: 666


Script:

#!/bin/bash
# Let's check the actual content of package.json to verify the dependencies
cat package.json

Length of output: 5576

scripts/tools/tools-object.js (1)

11-11: Verify logger configuration.

Let's ensure the logger is properly configured with appropriate log levels and transports as mentioned in the PR objectives.

✅ Verification successful

Logger configuration is properly set up with comprehensive logging capabilities

The logger implementation is well-configured with:

  • Appropriate log levels (default: 'info')
  • Console transport with colorized output and timestamps
  • File transports for both error-specific ('logs/error.log') and combined logs ('logs/combined.log')
  • Required dependencies ([email protected] and [email protected]) are properly specified
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check logger configuration
echo "Checking logger configuration..."
rg -A 10 "createLogger|configure" logger.js

# Verify Winston dependencies
echo "Verifying Winston dependencies..."
grep -A 5 '"winston"' package.json
grep -A 5 '"winston-timestamp-colorize"' package.json

Length of output: 1392

🧰 Tools
🪛 eslint

[error] 11-12: Replace "../../logger");⏎ with '../../logger');

(prettier/prettier)

package.json (3)

118-119: Dependencies organization looks good.

The addition of Winston and its colorize plugin aligns well with the PR objectives to implement custom logging with enhanced formatting. The dependencies are properly organized based on their usage.

Also applies to: 156-156


156-156: Verify the impact of moving fast-xml-parser to devDependencies.

The fast-xml-parser package has been moved from dependencies to devDependencies. This change implies it's only needed during development.

✅ Verification successful

Moving fast-xml-parser to devDependencies appears safe

The package is only referenced in package.json and package-lock.json files, with no usage found in the actual source code. This confirms it's safe to keep it in devDependencies since it's not being used in production code.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if fast-xml-parser is used in production code

# Search for fast-xml-parser imports in source files
echo "Checking for fast-xml-parser usage in source files..."
rg -g '!node_modules' -g '!test' -g '!*.test.*' -g '!*.spec.*' 'require.*fast-xml-parser|from.*fast-xml-parser'

Length of output: 403


Script:

#!/bin/bash
# Search for fast-xml-parser usage with different patterns and file types
echo "Searching for fast-xml-parser imports..."
rg -l "fast-xml-parser" --type-add 'src:*.{js,ts,jsx,tsx}' -g '!{test,tests,__tests__}/**' -g '!**/*.{test,spec}.*'

# Search for XML parsing related functionality
echo -e "\nSearching for XML parsing patterns..."
rg "XMLParser|parseXML|xml.*parse" --type-add 'src:*.{js,ts,jsx,tsx}' -g '!{test,tests,__tests__}/**' -g '!**/*.{test,spec}.*' -A 2

Length of output: 1122


118-119: Consider updating to the latest stable Winston version.

The PR introduces Winston for logging, but version 3.17.0 is ahead of the latest stable release (3.11.0). This could lead to stability issues.

Comment on lines +4 to +24
const customFormat = format.combine(
format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss' }),
winstonTimestampColorize(),
format.colorize({all:true}),
format.printf(({ level, timestamp, message, stack, tool_name, url }) => {

let logMessage = `${level} at ${timestamp}`;
logMessage += `\n${message}`;
if (tool_name) {
logMessage += `\n Tool: ${tool_name}`;
}
if (url) {
logMessage += `\n URL: ${url}`;
}
if (stack) {
logMessage += `\n Stack: ${stack}`;
}
return logMessage;
}),

);
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Well-structured logging format with room for improvement

The custom format provides comprehensive logging with timestamps, colors, and structured output. However, there are a few improvements needed:

  1. Follow JavaScript naming conventions by using camelCase:
-format.printf(({ level, timestamp, message, stack, tool_name, url }) => {
+format.printf(({ level, timestamp, message, stack, toolName, url }) => {
   let logMessage = `${level} at ${timestamp}`;
   logMessage += `\n${message}`;
-  if (tool_name) {
-    logMessage += `\n   Tool: ${tool_name}`;
+  if (toolName) {
+    logMessage += `\n   Tool: ${toolName}`;
   }
  1. Remove unnecessary empty line at line 9
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const customFormat = format.combine(
format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss' }),
winstonTimestampColorize(),
format.colorize({all:true}),
format.printf(({ level, timestamp, message, stack, tool_name, url }) => {
let logMessage = `${level} at ${timestamp}`;
logMessage += `\n${message}`;
if (tool_name) {
logMessage += `\n Tool: ${tool_name}`;
}
if (url) {
logMessage += `\n URL: ${url}`;
}
if (stack) {
logMessage += `\n Stack: ${stack}`;
}
return logMessage;
}),
);
const customFormat = format.combine(
format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss' }),
winstonTimestampColorize(),
format.colorize({all:true}),
format.printf(({ level, timestamp, message, stack, toolName, url }) => {
let logMessage = `${level} at ${timestamp}`;
logMessage += `\n${message}`;
if (toolName) {
logMessage += `\n Tool: ${toolName}`;
}
if (url) {
logMessage += `\n URL: ${url}`;
}
if (stack) {
logMessage += `\n Stack: ${stack}`;
}
return logMessage;
}),
);
🧰 Tools
🪛 eslint

[error] 5-5: Delete ·

(prettier/prettier)


[error] 6-6: Delete ·

(prettier/prettier)


[error] 7-7: Replace all:true}),· with ·all:·true·}),

(prettier/prettier)


[error] 8-8: Identifier 'tool_name' is not in camel case.

(camelcase)


[error] 8-9: Delete ⏎··

(prettier/prettier)


[error] 12-12: Delete ··

(prettier/prettier)


[error] 12-12: Identifier 'tool_name' is not in camel case.

(camelcase)


[error] 13-13: Delete ··

(prettier/prettier)


[error] 13-13: Identifier 'tool_name' is not in camel case.

(camelcase)


[error] 14-14: Delete ··

(prettier/prettier)


[error] 15-15: Delete ··

(prettier/prettier)


[error] 16-16: Replace ········ with ······

(prettier/prettier)


[error] 17-17: Delete ··

(prettier/prettier)


[error] 18-18: Delete ··

(prettier/prettier)


[error] 19-19: Delete ··

(prettier/prettier)


[error] 20-20: Delete ··

(prettier/prettier)


[error] 21-21: Delete ··

(prettier/prettier)


[error] 22-23: Delete ,⏎

(prettier/prettier)

Comment on lines +100 to +111
// console.error('Script is not failing, it is just dropping errors for further investigation');
// console.error('Invalid .asyncapi-tool file.');
// console.error(`Located in: ${tool.html_url}`);
// console.error('Validation errors:', JSON.stringify(validate.errors, null, 2));

//Created a logger function using Winston and tested also
logger.error('Error processing tool', {
message: err.message,
stack: err.stack,
tool_name: tool?.name,
url: tool?.url
});
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix validation error logging implementation.

There are several issues in this block:

  1. The err variable is undefined as this is the validation block
  2. The validation errors from validate.errors are not being logged
  3. The comment on line 105 is unnecessary

Apply this fix:

-          // console.error('Script is not failing, it is just dropping errors for further investigation');
-          // console.error('Invalid .asyncapi-tool file.');
-          // console.error(`Located in: ${tool.html_url}`);
-          // console.error('Validation errors:', JSON.stringify(validate.errors, null, 2));
-          
-          //Created a logger function using Winston and tested also 
-            logger.error('Error processing tool', {
-              message: err.message,
-              stack: err.stack,
-              tool_name: tool?.name,
-              url: tool?.url
-            });          
+          logger.error('Invalid .asyncapi-tool file', {
+            validation_errors: validate.errors,
+            tool_name: tool?.name,
+            url: tool?.html_url
+          });
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// console.error('Script is not failing, it is just dropping errors for further investigation');
// console.error('Invalid .asyncapi-tool file.');
// console.error(`Located in: ${tool.html_url}`);
// console.error('Validation errors:', JSON.stringify(validate.errors, null, 2));
//Created a logger function using Winston and tested also
logger.error('Error processing tool', {
message: err.message,
stack: err.stack,
tool_name: tool?.name,
url: tool?.url
});
logger.error('Invalid .asyncapi-tool file', {
validation_errors: validate.errors,
tool_name: tool?.name,
url: tool?.html_url
});
🧰 Tools
🪛 eslint

[error] 104-104: Delete ··········

(prettier/prettier)


[error] 105-105: Expected exception block, space or tab after '//' in comment.

(spaced-comment)


[error] 105-105: Delete ·

(prettier/prettier)


[error] 106-106: Replace ············ with ··········

(prettier/prettier)


[error] 107-107: Delete ··

(prettier/prettier)


[error] 107-107: 'err' is not defined.

(no-undef)


[error] 108-108: Replace ·············· with ············

(prettier/prettier)


[error] 108-108: 'err' is not defined.

(no-undef)


[error] 109-109: Delete ··

(prettier/prettier)


[error] 110-110: Delete ··

(prettier/prettier)


[error] 111-111: Replace ············});·········· with ··········});

(prettier/prettier)

@SahilDahekar
Copy link
Contributor

Hey @YashGupt29 , please take a look at Contributing.md and follow the guidline for PR title and description.

@YashGupt29 YashGupt29 changed the title Add custom LogService with Winston for error logging feat: Added custom LogService with Winston for error logging Nov 23, 2024
@YashGupt29
Copy link
Author

Hey @SahilDahekar Thank you for sharing the info!!

@akshatnema akshatnema changed the title feat: Added custom LogService with Winston for error logging feat: add custom LogService with Winston for error logging Nov 23, 2024
Comment on lines +12 to +20
if (tool_name) {
logMessage += `\n Tool: ${tool_name}`;
}
if (url) {
logMessage += `\n URL: ${url}`;
}
if (stack) {
logMessage += `\n Stack: ${stack}`;
}
Copy link
Member

Choose a reason for hiding this comment

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

We need to setup custom logger for whole repo, not just for only one particular script

Copy link
Author

Choose a reason for hiding this comment

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

okay @akshatnema it will take some time i will do it in the coming days.Is there anything which i need to take care of from your side.

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