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

debug: add or update logs #381

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/services/announcement.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,12 +305,13 @@ const sendPrivateMessageToUser = async (saga: any) => {
const roleIds = options?.roleIds;
const categories = options?.engagementCategories;

logger.info(community, 'community');
logger.info(platform, 'platform');
logger.info(platformId, 'platformId');
logger.info(userIds, 'userIds');
logger.info(roleIds, 'roleIds');
logger.info(categories, 'categories');
console.log('sagaData', sagaData);
console.log('community', community);
console.log('platform', platform);
console.log('platformId', platformId);
console.log('userIds', userIds);
console.log('roleIds', roleIds);
console.log('categories', categories);
Comment on lines +308 to +314
Copy link

Choose a reason for hiding this comment

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

Avoid using console.log for logging and be cautious about logging sensitive data.

A few suggestions regarding the logging changes:

  • Instead of using console.log, it's recommended to use a proper logging framework (e.g., Winston, Bunyan) that supports log levels, formatting, and centralized log management. This will make it easier to control log verbosity in different environments and integrate with log aggregation tools.

  • Be cautious about logging potentially sensitive data like user IDs, role IDs, and platform IDs directly. Depending on your data privacy requirements, you may need to mask or omit this data from logs.

If you need any help setting up a logging framework or have questions about logging best practices, let me know and I'll be happy to assist!


if (userIds || roleIds || categories) {
const allDiscordIds = new Set<string>();
Expand Down
Loading