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

Format error logs in debug module [issue 9244] #9386

Conversation

anish-bhanwala-qp
Copy link
Contributor

@anish-bhanwala-qp anish-bhanwala-qp commented Apr 21, 2021

What it does

Fixes: #9244
In case where error is logged as console.error(error) it gets stringified to [object Object].
So replaced such occurrences with the format console.error('<Method> failed:', e).
Made changes only for the debug module.

How to test

I tested by manually throwing the error.

Review checklist

Reminder for reviewers

@anish-bhanwala-qp anish-bhanwala-qp force-pushed the debug-module-format_logs_9244 branch from 1756ae7 to b939b63 Compare April 21, 2021 10:58
@vince-fugnitto vince-fugnitto added the debug issues that related to debug functionality label Apr 21, 2021
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

@anishbhanwala thank you for your first contribution to the framework 👍

Do you mind updating amending the commit to provide a more meaningful title, at the moment it is your sign-off which does not mean much in the git history:

commit b939b63ee6074253c3b809af19bd1f8255f36f75 (HEAD -> anishbhanwala-debug-module-format_logs_9244)
Author: Anish Bhanwala <[email protected]>
Date:   Wed Apr 21 15:41:12 2021 +0530

    Signed-off-by: Anish Bhanwala <[email protected]>
    
    Related to issue: #9244
    
    In case where error is logged as console.error(error) it gets stringified to [object Object].
    So replaced such occurrences with the format console.error('<Method> failed:', e).

@colin-grant-work I have not followed the discussion closely, should we be prefixing the errors with debug - so errors like setValue or saveAll are more meaningful?

    In case where error is logged as console.error(error) it gets stringified to [object Object].
    So replaced such occurrences with the format console.error('<Method> failed:', e).

Signed-off-by: Anish Bhanwala <[email protected]>
@anish-bhanwala-qp anish-bhanwala-qp force-pushed the debug-module-format_logs_9244 branch from b939b63 to c123624 Compare April 21, 2021 12:21
@anish-bhanwala-qp
Copy link
Contributor Author

@anishbhanwala thank you for your first contribution to the framework 👍

Do you mind updating amending the commit to provide a more meaningful title, at the moment it is your sign-off which does not mean much in the git history:

commit b939b63ee6074253c3b809af19bd1f8255f36f75 (HEAD -> anishbhanwala-debug-module-format_logs_9244)
Author: Anish Bhanwala <[email protected]>
Date:   Wed Apr 21 15:41:12 2021 +0530

    Signed-off-by: Anish Bhanwala <[email protected]>
    
    Related to issue: #9244
    
    In case where error is logged as console.error(error) it gets stringified to [object Object].
    So replaced such occurrences with the format console.error('<Method> failed:', e).

@colin-grant-work I have not followed the discussion closely, should we be prefixing the errors with debug - so errors like setValue or saveAll are more meaningful?

@vince-fugnitto I have updated the commit message. Please check if it makes sense now.

@vince-fugnitto
Copy link
Member

@vince-fugnitto I have updated the commit message. Please check if it makes sense now.

Thank you!

@colin-grant-work
Copy link
Contributor

@colin-grant-work I have not followed the discussion closely, should we be prefixing the errors with debug - so errors like setValue or saveAll are more meaningful?

@vince-fugnitto, that's certainly an option, but I don't think it's necessary. The problem before this change is that the log would say only [object Object]. Now that the actual error will appear, it should provide enough information to clarify what's going on.

Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

@anishbhanwala the changes look good to me, I look forward to many more contributions in the future!

@anish-bhanwala-qp
Copy link
Contributor Author

@anishbhanwala the changes look good to me, I look forward to many more contributions in the future!

@vince-fugnitto
Awesome! Thank you!

Yes, I will try to find some issue today. If you have any suggestions that would be helpful.

@colin-grant-work colin-grant-work merged commit a44dfac into eclipse-theia:master Apr 21, 2021
@vince-fugnitto vince-fugnitto added this to the 1.13.0 milestone Apr 29, 2021
@vince-fugnitto vince-fugnitto mentioned this pull request May 5, 2021
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debug issues that related to debug functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Illegible Error Logs in Debug Module
3 participants