Skip to content
This repository has been archived by the owner on Jan 28, 2023. It is now read-only.

feat: Custom log and error handlers #142

Merged
merged 15 commits into from
Dec 30, 2021

Conversation

DhansAL
Copy link
Contributor

@DhansAL DhansAL commented Dec 16, 2021

Description

This closes issue #141 and adds some code enhancements.

what this pull request includes :

  1. custom log and error handlers which include additional features like,
  • logging according to the severity of bug or log ( 7 different levels )
  • the capability to export all the logs of different levels to an external log file while production
  • control over console format (include timestamps etc )
  1. Added error handling on all modules.
  2. Restructured the code, added src directory.

Check List (mark all applicable checkboxes)

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • This PR does not contain plagiarized content.
  • The title of my pull request is a short description of the requested changes.

Screenshots (if applicable)

Original Updated
original screenshot updated screenshot

add src directory and refactor imports
add a custom loghandler util function
create a custom error handler with sending error as embbed message functionality
restructure code ,create custom loggers,add error handling in all modules
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.

Yeah! You did it 🎉 Now, Relax 😉 -> Grab a drink ☕ -> And wait for the maintainers to check your contributions. Meanwhile, you can discuss on other issues and solve them 😀

If you would like to continue contributing to open source and would like to do it with an awesome inclusive community, you should join our Discord Server - we help and encourage each other to contribute to open source little and often 🤓 Any questions, let us know!

@DhansAL DhansAL changed the title Loghandler#141 feat: Custom log and error handlers Dec 16, 2021
Copy link
Collaborator

@Panquesito7 Panquesito7 left a comment

Choose a reason for hiding this comment

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

Awesome work! 🚀

src/Commands/DSA.js Outdated Show resolved Hide resolved
value: 'https://github.com/kunal-kushwaha/DSA-Bootcamp-Java',
},
{
name: 'Try hands on git',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
name: 'Try hands on git',
name: 'Try hands on Git',

src/Commands/help.js Outdated Show resolved Hide resolved
src/Commands/links.js Outdated Show resolved Hide resolved
src/Commands/DSA.js Outdated Show resolved Hide resolved
value: 'https://www.instagram.com/commclassroom/',
},
{
name: 'Youtube',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
name: 'Youtube',
name: 'YouTube',

activity: {
name: 'cm!help',
type: 'LISTENING',
url: 'https://github.com/commclassroom/classroom-monitor-bot.',
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this dot should be removed.

Suggested change
url: 'https://github.com/commclassroom/classroom-monitor-bot.',
url: 'https://github.com/commclassroom/classroom-monitor-bot',

src/Commands/source.js Outdated Show resolved Hide resolved
'https://discord.js.org'
)
.setDescription(
'Open source discord bot made for ✨Community Classroom✨'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
'Open source discord bot made for ✨Community Classroom✨'
'Open Source Discord bot made by and for ✨Community Classroom✨'

'Open source discord bot made for ✨Community Classroom✨'
)
.addFields({
name: 'Github',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
name: 'Github',
name: 'GitHub',

@DhansAL
Copy link
Contributor Author

DhansAL commented Dec 17, 2021

done ^_^

@DhansAL DhansAL requested a review from Panquesito7 December 19, 2021 06:22
@DhansAL
Copy link
Contributor Author

DhansAL commented Dec 19, 2021

if there's a problem with my pull request? please let me know ^_^

Copy link
Contributor

@siddhant-khisty siddhant-khisty left a comment

Choose a reason for hiding this comment

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

Looks good except for a few typos. Please fix the typos suggested by Panquesito. Also kindly remove the University Leader field as the program is discontinued

value: 'https://t.me/commclassroom',
},
{
name: 'Become University Leader',
Copy link
Contributor

Choose a reason for hiding this comment

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

University Leader Program was discontinued. Kindly Remove this field

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure!

@DhansAL
Copy link
Contributor Author

DhansAL commented Dec 20, 2021

I have removed all typos and the deprecated University field leader code. please have a look :)

Copy link
Contributor

@siddhant-khisty siddhant-khisty left a comment

Choose a reason for hiding this comment

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

LGTM

src/Commands/DSA.js Outdated Show resolved Hide resolved
.setTitle('Community monitor for help')
.setURL('https://github.com/commclassroom/classroom-monitor-bot')
.setAuthor(
'Classroon monitor',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
'Classroon monitor',
'Classroom Monitor',

try {
module.exports = {
name: 'help',
description: 'sends the help command',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
description: 'sends the help command',
description: 'Sends a list of valid commands (a.k.a. help command)',

try {
module.exports = {
name: 'links',
description: 'sends the link relevant to comm classroom',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
description: 'sends the link relevant to comm classroom',
description: 'Sends all Community Classroom's socials',

.setTitle('Community Classroom Social accounts')
.setURL('https://github.com/commclassroom/classroom-monitor-bot')
.setAuthor(
'Classroon monitor',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
'Classroon monitor',
'Classroom Monitor',

try {
module.exports = {
name: 'source',
description: 'sends the source code of the bot',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
description: 'sends the source code of the bot',
description: 'Sends a link to the bot's source code',

.setTitle('Community Classroom Discord bot')
.setURL('https://github.com/commclassroom/classroom-monitor-bot')
.setAuthor(
'Classroon monitor',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
'Classroon monitor',
'Classroom Monitor',

Co-authored-by: David Leal <halfpacho@gmail.com>
Copy link
Collaborator

@Panquesito7 Panquesito7 left a comment

Choose a reason for hiding this comment

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

Many things are not fixed yet. Please fix them. 🙂

@DhansAL
Copy link
Contributor Author

DhansAL commented Dec 24, 2021

Many things are not fixed yet. Please fix them. 🙂

please check now ^_^

src/Commands/DSA.js Outdated Show resolved Hide resolved
@kaiwalyakoparkar
Copy link
Contributor

@Panquesito7 Can you have a look at this again (As you have gone through once and suggested changes)

Comment on lines 12 to 14
'Classroon Monitor',

'Classroom Monitor',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
'Classroon Monitor',
'Classroom Monitor',
'Classroom Monitor',

remove extra agrument value in dsa module
@DhansAL
Copy link
Contributor Author

DhansAL commented Dec 28, 2021

this request took longer than usual @Panquesito7 thanks for reviewing and guiding me through my errors ^_^

@DhansAL
Copy link
Contributor Author

DhansAL commented Dec 29, 2021

This pull request is covered by pull request #146 .

Copy link
Collaborator

@Panquesito7 Panquesito7 left a comment

Choose a reason for hiding this comment

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

These are all the issues that I see. After this, I'll give my approval. 🚀

.setTitle('Community Classroom DSA course details')
.setURL('https://github.com/commclassroom/classroom-monitor-bot')
.setAuthor(
'Classroon Monitor',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
'Classroon Monitor',
'Classroom Monitor',

)
.setTimestamp()
.setFooter(
'Want help? Classroom monitor is just `cm!help` far',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
'Want help? Classroom monitor is just `cm!help` far',
'Want help? Classroom Monitor is just `cm!help` far',

.setTitle('Community monitor for help')
.setURL('https://github.com/commclassroom/classroom-monitor-bot')
.setAuthor(
'Classroon Monitor',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
'Classroon Monitor',
'Classroom Monitor',

})
.setTimestamp()
.setFooter(
'Want help? Classroom monitor is just `cm!help` far',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
'Want help? Classroom monitor is just `cm!help` far',
'Want help? Classroom Monitor is just `cm!help` far',

.setTitle('Community Classroom Social accounts')
.setURL('https://github.com/commclassroom/classroom-monitor-bot')
.setAuthor(
'Classroon Monitor',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
'Classroon Monitor',
'Classroom Monitor',

)
.setTimestamp()
.setFooter(
'Want help? Classroom monitor is just `cm!help` far',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
'Want help? Classroom monitor is just `cm!help` far',
'Want help? Classroom Monitor is just `cm!help` far',

.setTitle('Community Classroom Discord bot')
.setURL('https://github.com/commclassroom/classroom-monitor-bot')
.setAuthor(
'Classroon Monitor',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
'Classroon Monitor',
'Classroom Monitor',

})
.setTimestamp()
.setFooter(
'Want help? Classroom monitor is just `cm!help` far',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
'Want help? Classroom monitor is just `cm!help` far',
'Want help? Classroom Monitor is just `cm!help` far',

@DhansAL
Copy link
Contributor Author

DhansAL commented Dec 29, 2021

done!

Copy link
Collaborator

@Panquesito7 Panquesito7 left a comment

Choose a reason for hiding this comment

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

LGTM 🚀 Thank you for your contribution! 😄👍

@Panquesito7 Panquesito7 merged commit dcda152 into WeMakeDevs:main Dec 30, 2021
@DhansAL DhansAL deleted the loghandler#141 branch December 30, 2021 15:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants