mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 12:55:22 +00:00
Add option to newsfeed for logging errors
- 'logFeedWarnings' added to newsfeed config, defaulted to false - Only log parse feed errors when logFeedWarnings is true - Updated README and CHANGELOG - Fixes #1329
This commit is contained in:
@@ -14,9 +14,10 @@ var iconv = require("iconv-lite");
|
||||
*
|
||||
* attribute url string - URL of the news feed.
|
||||
* attribute reloadInterval number - Reload interval in milliseconds.
|
||||
* attribute logFeedWarnings boolean - Log warnings when there is an error parsing a news article.
|
||||
*/
|
||||
|
||||
var Fetcher = function(url, reloadInterval, encoding) {
|
||||
var Fetcher = function(url, reloadInterval, encoding, logFeedWarnings) {
|
||||
var self = this;
|
||||
if (reloadInterval < 1000) {
|
||||
reloadInterval = 1000;
|
||||
@@ -60,7 +61,7 @@ var Fetcher = function(url, reloadInterval, encoding) {
|
||||
url: url,
|
||||
});
|
||||
|
||||
} else {
|
||||
} else if (logFeedWarnings) {
|
||||
console.log("Can't parse feed item:");
|
||||
console.log(item);
|
||||
console.log("Title: " + title);
|
||||
|
Reference in New Issue
Block a user