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

Improve debug logs #342

Merged
merged 10 commits into from
May 6, 2024
Merged

Improve debug logs #342

merged 10 commits into from
May 6, 2024

Conversation

panleone
Copy link
Member

@panleone panleone commented Apr 12, 2024

Abstract

debug logging imo is very important, but at the moment is quite unused since we have to wrap each console.log inside a if(debug){...}
This PR solves the issue by adding some util functions like debugLog;
DebugTopics are also added, so we can easily understand which part of the application printed the message
finally DebugTopics can be activated and deactivated: this can be done from the file debug_config.json


Testing

Activate debug and see that it works as expected

@panleone panleone added the Enhancement New feature or request label Apr 12, 2024
@panleone panleone requested review from JSKitty and Duddino April 12, 2024 14:39
@panleone panleone self-assigned this Apr 12, 2024
Copy link

netlify bot commented Apr 12, 2024

Deploy Preview for cheery-moxie-4f1121 ready!

Name Link
🔨 Latest commit 1365249
🔍 Latest deploy log https://app.netlify.com/sites/cheery-moxie-4f1121/deploys/66337dac4150eb0008fa7fa3
😎 Deploy Preview https://deploy-preview-342--cheery-moxie-4f1121.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.

Copy link
Member

@Duddino Duddino left a comment

Choose a reason for hiding this comment

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

It's also useful to have a way to disable certain topics. If I'm debugging network, I usually don't want logs for wallet for example. You can do this by putting the setting in a config file, (see chainparams.json). You can also add log error levels (Debug, warn, error) and a way to filter (use the console functions so we can also filter them using the dev tools).

@panleone panleone marked this pull request as draft April 17, 2024 13:43
@panleone panleone requested a review from Duddino April 28, 2024 07:16
@panleone panleone marked this pull request as ready for review April 28, 2024 07:16
@panleone
Copy link
Member Author

ready for review

Copy link
Member

@JSKitty JSKitty left a comment

Choose a reason for hiding this comment

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

tACK 1365249

@Duddino Duddino merged commit cb3a3a2 into PIVX-Labs:master May 6, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants