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 core functionality (Logging, Config comparison, Code Quality) #2464

Merged
merged 15 commits into from
Jul 24, 2024

Conversation

PKief
Copy link
Member

@PKief PKief commented Jul 24, 2024

Description

  • Add logging configuration enableLogging and logLevel
  • If logging is enabled the logs are printed to the output "Material Icon Theme"
  • All console.log statements have been replaced with the logger
  • The logging itself is implement asynchronously with EventEmitter so that log events of the core module can be observed in the extension module
  • Improvements of the node fs API usage (async/await instead of sync)
  • Writing of files is only done if necessary by the changed config

Logging information can be configured like this:

{
  "material-icon-theme.enableLogging": true,
  "material-icon-theme.logLevel": "debug",
}

Related to #2428.

Contribution Guidelines

@PKief PKief self-assigned this Jul 24, 2024
@PKief
Copy link
Member Author

PKief commented Jul 24, 2024

#2428 might be fixed with this PR. The write file logic was called too often if it wasn't necessary. It was called if the saturation or opacity was not changed but wrote all of the files in the icons directory with the same content. As there were too many operations on the fs it might have caused some performance issues and removed the content of some SVG files.

@PKief PKief merged commit 95ccb29 into main Jul 24, 2024
2 checks passed
@PKief PKief deleted the chore/refactor-core branch July 24, 2024 19:13
Copy link

Merge Successful

Thanks for your contribution! 🎉

The changes will be part of the upcoming update on the marketplace.

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.

1 participant