ekalinin / sitemap.js

Sitemap-generating framework for node.js
MIT License
1.59k stars 157 forks source link

[Feature] replace console logs with logger #348

Open marcoreni opened 3 years ago

marcoreni commented 3 years ago

Is your feature request related to a problem? Please describe. After #337, some references to console.warn are still in the codebase:

It should be useful to switch to a logger implementation entirely.

Describe the solution you'd like 1- Pass a logger inside the options, that defaults to console. (for backwards compatibility), 2- AND/OR allow to pass a custom "handleError" function as an option, so that we can customize the handling of internal errors.

derduher commented 3 years ago

Thanks for your PR. I've merged and released it. It looks like validator's console.warn still needs to be handled. I'll take a look at that tomorrow.