bit more logging when discovering feeds
This commit is contained in:
parent
d009769041
commit
2c30d63df5
13 changed files with 119 additions and 50 deletions
|
@ -5,6 +5,7 @@
|
|||
#define DEFAULT_FEED_TYPE "RSS"
|
||||
#define FEED_INITIAL_OPML_PATTERN "feeds-%1.opml"
|
||||
#define DEFAULT_ENCLOSURE_MIME_TYPE "image/jpg"
|
||||
#define LOGSEC_STANDARD "standard: "
|
||||
|
||||
#define ADVANCED_FEED_ADD_DIALOG_CODE 64
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ QList<StandardFeed*> AtomParser::discoverFeeds(ServiceRoot* root, const QUrl& ur
|
|||
return {guessed_feed.first};
|
||||
}
|
||||
catch (...) {
|
||||
qDebugNN << LOGSEC_CORE << QUOTE_W_SPACE(my_url) << "is not a direct feed file.";
|
||||
qDebugNN << LOGSEC_STANDARD << QUOTE_W_SPACE(my_url) << "is not a direct feed file.";
|
||||
}
|
||||
|
||||
// 2.
|
||||
|
@ -116,12 +116,15 @@ QList<StandardFeed*> AtomParser::discoverFeeds(ServiceRoot* root, const QUrl& ur
|
|||
feeds.append(guessed_feed.first);
|
||||
}
|
||||
catch (const ApplicationException& ex) {
|
||||
qDebugNN << LOGSEC_CORE << QUOTE_W_SPACE(feed_link)
|
||||
qDebugNN << LOGSEC_STANDARD << QUOTE_W_SPACE(feed_link)
|
||||
<< " should be direct link to feed file but was not recognized:" << QUOTE_W_SPACE_DOT(ex.message());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
logUnsuccessfulRequest(res);
|
||||
}
|
||||
|
||||
// 3.
|
||||
my_url = url.toString(QUrl::UrlFormattingOption::StripTrailingSlash) + QSL("/feed");
|
||||
|
@ -143,9 +146,12 @@ QList<StandardFeed*> AtomParser::discoverFeeds(ServiceRoot* root, const QUrl& ur
|
|||
feeds.append(guessed_feed.first);
|
||||
}
|
||||
catch (...) {
|
||||
qDebugNN << LOGSEC_CORE << QUOTE_W_SPACE(my_url) << "is not a direct feed file.";
|
||||
qDebugNN << LOGSEC_STANDARD << QUOTE_W_SPACE(my_url) << "is not a direct feed file.";
|
||||
}
|
||||
}
|
||||
else {
|
||||
logUnsuccessfulRequest(res);
|
||||
}
|
||||
|
||||
// 4.
|
||||
my_url = url.toString(QUrl::UrlFormattingOption::StripTrailingSlash) + QSL("/atom");
|
||||
|
@ -167,9 +173,12 @@ QList<StandardFeed*> AtomParser::discoverFeeds(ServiceRoot* root, const QUrl& ur
|
|||
feeds.append(guessed_feed.first);
|
||||
}
|
||||
catch (...) {
|
||||
qDebugNN << LOGSEC_CORE << QUOTE_W_SPACE(my_url) << "is not a direct feed file.";
|
||||
qDebugNN << LOGSEC_STANDARD << QUOTE_W_SPACE(my_url) << "is not a direct feed file.";
|
||||
}
|
||||
}
|
||||
else {
|
||||
logUnsuccessfulRequest(res);
|
||||
}
|
||||
|
||||
// 5.
|
||||
my_url = url.toString(QUrl::UrlFormattingOption::StripTrailingSlash);
|
||||
|
@ -201,9 +210,12 @@ QList<StandardFeed*> AtomParser::discoverFeeds(ServiceRoot* root, const QUrl& ur
|
|||
feeds.append(guessed_feed.first);
|
||||
}
|
||||
catch (...) {
|
||||
qDebugNN << LOGSEC_CORE << QUOTE_W_SPACE(my_url) << "is not a direct feed file.";
|
||||
qDebugNN << LOGSEC_STANDARD << QUOTE_W_SPACE(my_url) << "is not a direct feed file.";
|
||||
}
|
||||
}
|
||||
else {
|
||||
logUnsuccessfulRequest(res);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -240,9 +252,12 @@ QList<StandardFeed*> AtomParser::discoverFeeds(ServiceRoot* root, const QUrl& ur
|
|||
feeds.append(guessed_feed.first);
|
||||
}
|
||||
catch (...) {
|
||||
qDebugNN << LOGSEC_CORE << QUOTE_W_SPACE(my_url) << "is not a direct feed file.";
|
||||
qDebugNN << LOGSEC_STANDARD << QUOTE_W_SPACE(my_url) << "is not a direct feed file.";
|
||||
}
|
||||
}
|
||||
else {
|
||||
logUnsuccessfulRequest(res);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -269,9 +284,12 @@ QList<StandardFeed*> AtomParser::discoverFeeds(ServiceRoot* root, const QUrl& ur
|
|||
feeds.append(guessed_feed.first);
|
||||
}
|
||||
catch (...) {
|
||||
qDebugNN << LOGSEC_CORE << QUOTE_W_SPACE(my_url) << "is not a direct feed file.";
|
||||
qDebugNN << LOGSEC_STANDARD << QUOTE_W_SPACE(my_url) << "is not a direct feed file.";
|
||||
}
|
||||
}
|
||||
else {
|
||||
logUnsuccessfulRequest(res);
|
||||
}
|
||||
}
|
||||
|
||||
return feeds;
|
||||
|
|
|
@ -64,8 +64,9 @@ QList<StandardFeed*> FeedParser::discoverFeeds(ServiceRoot* root, const QUrl& ur
|
|||
|
||||
return {guessed_feed.first};
|
||||
}
|
||||
catch (...) {
|
||||
qDebugNN << LOGSEC_CORE << QUOTE_W_SPACE(file_path) << "is not a local feed file.";
|
||||
catch (const ApplicationException& ex) {
|
||||
qDebugNN << LOGSEC_STANDARD << QUOTE_W_SPACE(file_path)
|
||||
<< "is not a local feed file:" << NONQUOTE_W_SPACE_DOT(ex.message());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -171,6 +172,12 @@ QString FeedParser::objMessageRawContents(const QVariant& msg_element) const {
|
|||
return {};
|
||||
}
|
||||
|
||||
void FeedParser::logUnsuccessfulRequest(const NetworkResult& reply) const {
|
||||
qWarningNN << LOGSEC_STANDARD << "Feed discovery network request for" << QUOTE_W_SPACE(reply.m_url.toString())
|
||||
<< "failed with reason" << QUOTE_W_SPACE(reply.m_networkError) << "and HTTP code"
|
||||
<< QUOTE_W_SPACE_DOT(reply.m_httpCode);
|
||||
}
|
||||
|
||||
QList<Message> FeedParser::messages() {
|
||||
QString feed_author = feedAuthor();
|
||||
QList<Message> messages;
|
||||
|
@ -201,7 +208,7 @@ QList<Message> FeedParser::messages() {
|
|||
messages.append(new_message);
|
||||
}
|
||||
catch (const ApplicationException& ex) {
|
||||
qDebugNN << LOGSEC_CORE << "Problem when extracting XML message: " << ex.message();
|
||||
qDebugNN << LOGSEC_STANDARD << "Problem when extracting XML message: " << ex.message();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -227,7 +234,7 @@ QList<Message> FeedParser::messages() {
|
|||
messages.append(new_message);
|
||||
}
|
||||
catch (const ApplicationException& ex) {
|
||||
qDebugNN << LOGSEC_CORE << "Problem when extracting JSON message: " << ex.message();
|
||||
qDebugNN << LOGSEC_STANDARD << "Problem when extracting JSON message: " << ex.message();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -251,7 +258,7 @@ QList<Message> FeedParser::messages() {
|
|||
messages.append(new_message);
|
||||
}
|
||||
catch (const ApplicationException& ex) {
|
||||
qDebugNN << LOGSEC_CORE << "Problem when extracting OBJ message: " << ex.message();
|
||||
qDebugNN << LOGSEC_STANDARD << "Problem when extracting OBJ message: " << ex.message();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,6 +84,7 @@ class FeedParser {
|
|||
virtual QString objMessageRawContents(const QVariant& msg_element) const;
|
||||
|
||||
protected:
|
||||
void logUnsuccessfulRequest(const NetworkResult& reply) const;
|
||||
QList<Enclosure> xmlMrssGetEnclosures(const QDomElement& msg_element) const;
|
||||
QString xmlMrssTextFromPath(const QDomElement& msg_element, const QString& xml_path) const;
|
||||
QString xmlRawChild(const QDomElement& container) const;
|
||||
|
|
|
@ -48,9 +48,12 @@ QList<StandardFeed*> IcalParser::discoverFeeds(ServiceRoot* root, const QUrl& ur
|
|||
return {guessed_feed.first};
|
||||
}
|
||||
catch (...) {
|
||||
qDebugNN << LOGSEC_CORE << QUOTE_W_SPACE(my_url) << "is not a direct feed file.";
|
||||
qDebugNN << LOGSEC_STANDARD << QUOTE_W_SPACE(my_url) << "is not a direct feed file.";
|
||||
}
|
||||
}
|
||||
else {
|
||||
logUnsuccessfulRequest(res);
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ QList<StandardFeed*> JsonParser::discoverFeeds(ServiceRoot* root, const QUrl& ur
|
|||
return {guessed_feed.first};
|
||||
}
|
||||
catch (...) {
|
||||
qDebugNN << LOGSEC_CORE << QUOTE_W_SPACE(my_url) << "is not a direct feed file.";
|
||||
qDebugNN << LOGSEC_STANDARD << QUOTE_W_SPACE(my_url) << "is not a direct feed file.";
|
||||
}
|
||||
|
||||
// 2.
|
||||
|
@ -100,12 +100,18 @@ QList<StandardFeed*> JsonParser::discoverFeeds(ServiceRoot* root, const QUrl& ur
|
|||
feeds.append(guessed_feed.first);
|
||||
}
|
||||
catch (const ApplicationException& ex) {
|
||||
qDebugNN << LOGSEC_CORE << QUOTE_W_SPACE(feed_link)
|
||||
qDebugNN << LOGSEC_STANDARD << QUOTE_W_SPACE(feed_link)
|
||||
<< " should be direct link to feed file but was not recognized:" << QUOTE_W_SPACE_DOT(ex.message());
|
||||
}
|
||||
}
|
||||
else {
|
||||
logUnsuccessfulRequest(res);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
logUnsuccessfulRequest(res);
|
||||
}
|
||||
|
||||
return feeds;
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ QList<StandardFeed*> RdfParser::discoverFeeds(ServiceRoot* root, const QUrl& url
|
|||
return {guessed_feed.first};
|
||||
}
|
||||
catch (...) {
|
||||
qDebugNN << LOGSEC_CORE << QUOTE_W_SPACE(my_url) << "is not a direct feed file.";
|
||||
qDebugNN << LOGSEC_STANDARD << QUOTE_W_SPACE(my_url) << "is not a direct feed file.";
|
||||
}
|
||||
|
||||
// 2.
|
||||
|
@ -101,12 +101,18 @@ QList<StandardFeed*> RdfParser::discoverFeeds(ServiceRoot* root, const QUrl& url
|
|||
feeds.append(guessed_feed.first);
|
||||
}
|
||||
catch (const ApplicationException& ex) {
|
||||
qDebugNN << LOGSEC_CORE << QUOTE_W_SPACE(feed_link)
|
||||
qDebugNN << LOGSEC_STANDARD << QUOTE_W_SPACE(feed_link)
|
||||
<< " should be direct link to feed file but was not recognized:" << QUOTE_W_SPACE_DOT(ex.message());
|
||||
}
|
||||
}
|
||||
else {
|
||||
logUnsuccessfulRequest(res);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
logUnsuccessfulRequest(res);
|
||||
}
|
||||
|
||||
// 3.
|
||||
my_url = url.toString(QUrl::UrlFormattingOption::StripTrailingSlash) + QSL("/feed");
|
||||
|
@ -128,9 +134,12 @@ QList<StandardFeed*> RdfParser::discoverFeeds(ServiceRoot* root, const QUrl& url
|
|||
feeds.append(guessed_feed.first);
|
||||
}
|
||||
catch (...) {
|
||||
qDebugNN << LOGSEC_CORE << QUOTE_W_SPACE(my_url) << "is not a direct feed file.";
|
||||
qDebugNN << LOGSEC_STANDARD << QUOTE_W_SPACE(my_url) << "is not a direct feed file.";
|
||||
}
|
||||
}
|
||||
else {
|
||||
logUnsuccessfulRequest(res);
|
||||
}
|
||||
|
||||
// 4.
|
||||
my_url = url.toString(QUrl::UrlFormattingOption::StripTrailingSlash) + QSL("/rdf");
|
||||
|
@ -152,9 +161,12 @@ QList<StandardFeed*> RdfParser::discoverFeeds(ServiceRoot* root, const QUrl& url
|
|||
feeds.append(guessed_feed.first);
|
||||
}
|
||||
catch (...) {
|
||||
qDebugNN << LOGSEC_CORE << QUOTE_W_SPACE(my_url) << "is not a direct feed file.";
|
||||
qDebugNN << LOGSEC_STANDARD << QUOTE_W_SPACE(my_url) << "is not a direct feed file.";
|
||||
}
|
||||
}
|
||||
else {
|
||||
logUnsuccessfulRequest(res);
|
||||
}
|
||||
|
||||
return feeds;
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ QList<StandardFeed*> RssParser::discoverFeeds(ServiceRoot* root, const QUrl& url
|
|||
return {guessed_feed.first};
|
||||
}
|
||||
catch (...) {
|
||||
qDebugNN << LOGSEC_CORE << QUOTE_W_SPACE(my_url) << "is not a direct feed file.";
|
||||
qDebugNN << LOGSEC_STANDARD << QUOTE_W_SPACE(my_url) << "is not a direct feed file.";
|
||||
}
|
||||
|
||||
// 2.
|
||||
|
@ -101,12 +101,18 @@ QList<StandardFeed*> RssParser::discoverFeeds(ServiceRoot* root, const QUrl& url
|
|||
feeds.append(guessed_feed.first);
|
||||
}
|
||||
catch (const ApplicationException& ex) {
|
||||
qDebugNN << LOGSEC_CORE << QUOTE_W_SPACE(feed_link)
|
||||
qDebugNN << LOGSEC_STANDARD << QUOTE_W_SPACE(feed_link)
|
||||
<< " should be direct link to feed file but was not recognized:" << QUOTE_W_SPACE_DOT(ex.message());
|
||||
}
|
||||
}
|
||||
else {
|
||||
logUnsuccessfulRequest(res);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
logUnsuccessfulRequest(res);
|
||||
}
|
||||
|
||||
// 3.
|
||||
my_url = url.toString(QUrl::UrlFormattingOption::StripTrailingSlash) + QSL("/feed");
|
||||
|
@ -128,9 +134,12 @@ QList<StandardFeed*> RssParser::discoverFeeds(ServiceRoot* root, const QUrl& url
|
|||
feeds.append(guessed_feed.first);
|
||||
}
|
||||
catch (...) {
|
||||
qDebugNN << LOGSEC_CORE << QUOTE_W_SPACE(my_url) << "is not a direct feed file.";
|
||||
qDebugNN << LOGSEC_STANDARD << QUOTE_W_SPACE(my_url) << "is not a direct feed file.";
|
||||
}
|
||||
}
|
||||
else {
|
||||
logUnsuccessfulRequest(res);
|
||||
}
|
||||
|
||||
// 4.
|
||||
my_url = url.toString(QUrl::UrlFormattingOption::StripTrailingSlash) + QSL("/rss");
|
||||
|
@ -152,9 +161,12 @@ QList<StandardFeed*> RssParser::discoverFeeds(ServiceRoot* root, const QUrl& url
|
|||
feeds.append(guessed_feed.first);
|
||||
}
|
||||
catch (...) {
|
||||
qDebugNN << LOGSEC_CORE << QUOTE_W_SPACE(my_url) << "is not a direct feed file.";
|
||||
qDebugNN << LOGSEC_STANDARD << QUOTE_W_SPACE(my_url) << "is not a direct feed file.";
|
||||
}
|
||||
}
|
||||
else {
|
||||
logUnsuccessfulRequest(res);
|
||||
}
|
||||
|
||||
return feeds;
|
||||
}
|
||||
|
|
|
@ -86,6 +86,9 @@ QList<StandardFeed*> SitemapParser::discoverFeeds(ServiceRoot* root, const QUrl&
|
|||
to_process_sitemaps.append(sitemap_link);
|
||||
}
|
||||
}
|
||||
else {
|
||||
logUnsuccessfulRequest(res);
|
||||
}
|
||||
}
|
||||
|
||||
// 4.
|
||||
|
@ -137,9 +140,12 @@ QList<StandardFeed*> SitemapParser::discoverFeeds(ServiceRoot* root, const QUrl&
|
|||
}
|
||||
}
|
||||
catch (const ApplicationException&) {
|
||||
qDebugNN << LOGSEC_CORE << QUOTE_W_SPACE(my_url) << "is not a direct sitemap file.";
|
||||
qDebugNN << LOGSEC_STANDARD << QUOTE_W_SPACE(my_url) << "is not a direct sitemap file.";
|
||||
}
|
||||
}
|
||||
else {
|
||||
logUnsuccessfulRequest(res);
|
||||
}
|
||||
}
|
||||
|
||||
return feeds.values();
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include "src/standardfeed.h"
|
||||
|
||||
#include "src/definitions.h"
|
||||
#include "src/gui/formstandardfeeddetails.h"
|
||||
#include "src/standardserviceroot.h"
|
||||
|
||||
|
@ -346,7 +347,8 @@ QPair<StandardFeed*, NetworkResult> StandardFeed::guessFeed(StandardFeed::Source
|
|||
feed_contents = IOFactory::readFile(source);
|
||||
}
|
||||
else {
|
||||
qDebugNN << LOGSEC_CORE << "Running custom script for guessing" << QUOTE_W_SPACE(source) << "to obtain feed data.";
|
||||
qDebugNN << LOGSEC_STANDARD << "Running custom script for guessing" << QUOTE_W_SPACE(source)
|
||||
<< "to obtain feed data.";
|
||||
|
||||
// Use script to generate feed file.
|
||||
feed_contents = generateFeedFileWithScript(source, timeout);
|
||||
|
@ -357,7 +359,7 @@ QPair<StandardFeed*, NetworkResult> StandardFeed::guessFeed(StandardFeed::Source
|
|||
// stuff kicks in.
|
||||
if (SitemapParser::isGzip(feed_contents)) {
|
||||
#if defined(ENABLE_COMPRESSED_SITEMAP)
|
||||
qWarningNN << LOGSEC_CORE << "Decompressing gzipped feed data.";
|
||||
qWarningNN << LOGSEC_STANDARD << "Decompressing gzipped feed data.";
|
||||
|
||||
QByteArray uncompressed_feed_contents;
|
||||
|
||||
|
@ -367,12 +369,12 @@ QPair<StandardFeed*, NetworkResult> StandardFeed::guessFeed(StandardFeed::Source
|
|||
|
||||
feed_contents = uncompressed_feed_contents;
|
||||
#else
|
||||
qWarningNN << LOGSEC_CORE << "This feed is gzipped.";
|
||||
qWarningNN << LOGSEC_STANDARD << "This feed is gzipped.";
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!post_process_script.simplified().isEmpty()) {
|
||||
qDebugNN << LOGSEC_CORE << "Post-processing obtained feed data with custom script for guessing"
|
||||
qDebugNN << LOGSEC_STANDARD << "Post-processing obtained feed data with custom script for guessing"
|
||||
<< QUOTE_W_SPACE_DOT(post_process_script);
|
||||
feed_contents = postProcessFeedFileWithScript(post_process_script, feed_contents, timeout);
|
||||
}
|
||||
|
@ -403,7 +405,7 @@ QPair<StandardFeed*, NetworkResult> StandardFeed::guessFeed(StandardFeed::Source
|
|||
throw format_ex;
|
||||
}
|
||||
catch (const ApplicationException& ex) {
|
||||
qWarningNN << LOGSEC_CORE << "Feed guessing error:" << QUOTE_W_SPACE_DOT(ex.message());
|
||||
qWarningNN << LOGSEC_STANDARD << "Feed guessing error:" << QUOTE_W_SPACE_DOT(ex.message());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -559,7 +561,7 @@ QByteArray StandardFeed::runScriptProcess(const QStringList& cmd_args,
|
|||
auto raw_error = process.readAllStandardError();
|
||||
|
||||
if (!raw_error.simplified().isEmpty()) {
|
||||
qWarningNN << LOGSEC_CORE
|
||||
qWarningNN << LOGSEC_STANDARD
|
||||
<< "Received error output from "
|
||||
"custom script even if it "
|
||||
"reported that it exited "
|
||||
|
|
|
@ -253,7 +253,7 @@ bool FeedsImportExportModel::produceFeed(const FeedLookup& feed_lookup) {
|
|||
return true;
|
||||
}
|
||||
catch (const ApplicationException& ex) {
|
||||
qCriticalNN << LOGSEC_CORE << "Cannot fetch medatada for feed:" << QUOTE_W_SPACE(feed_lookup.url)
|
||||
qCriticalNN << LOGSEC_STANDARD << "Cannot fetch medatada for feed:" << QUOTE_W_SPACE(feed_lookup.url)
|
||||
<< "with error:" << QUOTE_W_SPACE_DOT(ex.message());
|
||||
|
||||
if (new_feed != nullptr) {
|
||||
|
@ -403,7 +403,7 @@ void FeedsImportExportModel::importAsOPML20(const QByteArray& data,
|
|||
qApp->icons()->fromByteArray(child_element.attribute(QSL("rssguard:icon")).toLocal8Bit());
|
||||
|
||||
if (category_title.isEmpty()) {
|
||||
qWarningNN << LOGSEC_CORE
|
||||
qWarningNN << LOGSEC_STANDARD
|
||||
<< "Given OMPL file provided category without valid text attribute. Using fallback name.";
|
||||
category_title = child_element.attribute(QSL("title"));
|
||||
|
||||
|
@ -496,7 +496,7 @@ void FeedsImportExportModel::importAsTxtURLPerLine(const QByteArray& data,
|
|||
lookup.append(f);
|
||||
}
|
||||
else {
|
||||
qWarningNN << LOGSEC_CORE << "Detected empty URL when parsing input TXT [one URL per line] data.";
|
||||
qWarningNN << LOGSEC_STANDARD << "Detected empty URL when parsing input TXT [one URL per line] data.";
|
||||
}
|
||||
|
||||
emit parsingProgress(++completed, urls.size());
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include "src/standardserviceentrypoint.h"
|
||||
|
||||
#include "src/definitions.h"
|
||||
#include "src/gui/formeditstandardaccount.h"
|
||||
#include "src/standardserviceroot.h"
|
||||
|
||||
|
@ -12,7 +13,7 @@
|
|||
StandardServiceEntryPoint::StandardServiceEntryPoint(QObject* parent) : QObject(parent) {}
|
||||
|
||||
StandardServiceEntryPoint::~StandardServiceEntryPoint() {
|
||||
qDebugNN << LOGSEC_CORE << "Destructing" << QUOTE_W_SPACE(QSL(SERVICE_CODE_STD_RSS)) << "plugin.";
|
||||
qDebugNN << LOGSEC_STANDARD << "Destructing" << QUOTE_W_SPACE(QSL(SERVICE_CODE_STD_RSS)) << "plugin.";
|
||||
}
|
||||
|
||||
QString StandardServiceEntryPoint::name() const {
|
||||
|
|
|
@ -109,7 +109,7 @@ void StandardServiceRoot::start(bool freshly_activated) {
|
|||
}
|
||||
|
||||
void StandardServiceRoot::stop() {
|
||||
qDebugNN << LOGSEC_CORE << "Stopping StandardServiceRoot instance.";
|
||||
qDebugNN << LOGSEC_STANDARD << "Stopping StandardServiceRoot instance.";
|
||||
}
|
||||
|
||||
QString StandardServiceRoot::code() const {
|
||||
|
@ -227,16 +227,16 @@ void StandardServiceRoot::spaceHost(const QString& host, const QString& url) {
|
|||
m_spacingMutex.unlock();
|
||||
|
||||
if (secs_to_wait > 0) {
|
||||
qDebugNN << LOGSEC_CORE << "Freezing feed with URL" << QUOTE_W_SPACE(url) << "for" << NONQUOTE_W_SPACE(secs_to_wait)
|
||||
qDebugNN << LOGSEC_STANDARD << "Freezing feed with URL" << QUOTE_W_SPACE(url) << "for" << NONQUOTE_W_SPACE(secs_to_wait)
|
||||
<< "seconds, because its host was used for fetching another feed during the spacing period.";
|
||||
QThread::sleep(ulong(secs_to_wait));
|
||||
qDebugNN << LOGSEC_CORE << "Freezing feed with URL" << QUOTE_W_SPACE(url) << "is done.";
|
||||
qDebugNN << LOGSEC_STANDARD << "Freezing feed with URL" << QUOTE_W_SPACE(url) << "is done.";
|
||||
}
|
||||
}
|
||||
|
||||
void StandardServiceRoot::resetHostSpacing(const QString& host, const QDateTime& next_dt) {
|
||||
m_spacingHosts.insert(host, next_dt);
|
||||
qDebugNN << LOGSEC_CORE << "Setting spacing for" << QUOTE_W_SPACE(host) << "to" << QUOTE_W_SPACE_DOT(next_dt);
|
||||
qDebugNN << LOGSEC_STANDARD << "Setting spacing for" << QUOTE_W_SPACE(host) << "to" << QUOTE_W_SPACE_DOT(next_dt);
|
||||
}
|
||||
|
||||
QList<Message> StandardServiceRoot::obtainNewMessages(Feed* feed,
|
||||
|
@ -255,7 +255,7 @@ QList<Message> StandardServiceRoot::obtainNewMessages(Feed* feed,
|
|||
if (f->sourceType() == StandardFeed::SourceType::Url) {
|
||||
spaceHost(host, f->source());
|
||||
|
||||
qDebugNN << LOGSEC_CORE << "Downloading URL" << QUOTE_W_SPACE(feed->source()) << "to obtain feed data.";
|
||||
qDebugNN << LOGSEC_STANDARD << "Downloading URL" << QUOTE_W_SPACE(feed->source()) << "to obtain feed data.";
|
||||
|
||||
QList<QPair<QByteArray, QByteArray>> headers = StandardFeed::httpHeadersToList(f->httpHeaders());
|
||||
|
||||
|
@ -283,7 +283,7 @@ QList<Message> StandardServiceRoot::obtainNewMessages(Feed* feed,
|
|||
// resetHostSpacing(host);
|
||||
|
||||
if (network_result.m_networkError != QNetworkReply::NetworkError::NoError) {
|
||||
qWarningNN << LOGSEC_CORE << "Error" << QUOTE_W_SPACE(network_result.m_networkError)
|
||||
qWarningNN << LOGSEC_STANDARD << "Error" << QUOTE_W_SPACE(network_result.m_networkError)
|
||||
<< "during fetching of new messages for feed" << QUOTE_W_SPACE_DOT(feed->source());
|
||||
throw FeedFetchException(Feed::Status::NetworkError,
|
||||
NetworkFactory::networkErrorText(network_result.m_networkError),
|
||||
|
@ -295,7 +295,7 @@ QList<Message> StandardServiceRoot::obtainNewMessages(Feed* feed,
|
|||
if (network_result.m_httpCode == HTTP_CODE_NOT_MODIFIED && feed_contents.trimmed().isEmpty()) {
|
||||
// We very likely used "eTag" before and server reports that
|
||||
// content was not modified since.
|
||||
qWarningNN << LOGSEC_CORE << QUOTE_W_SPACE(feed->source())
|
||||
qWarningNN << LOGSEC_STANDARD << QUOTE_W_SPACE(feed->source())
|
||||
<< "reported HTTP/304, meaning that the remote file did not change since last time we checked it.";
|
||||
return {};
|
||||
}
|
||||
|
@ -312,14 +312,14 @@ QList<Message> StandardServiceRoot::obtainNewMessages(Feed* feed,
|
|||
feed_contents = IOFactory::readFile(feed->source());
|
||||
}
|
||||
else {
|
||||
qDebugNN << LOGSEC_CORE << "Running custom script" << QUOTE_W_SPACE(feed->source()) << "to obtain feed data.";
|
||||
qDebugNN << LOGSEC_STANDARD << "Running custom script" << QUOTE_W_SPACE(feed->source()) << "to obtain feed data.";
|
||||
|
||||
// Use script to generate feed file.
|
||||
try {
|
||||
feed_contents = StandardFeed::generateFeedFileWithScript(feed->source(), download_timeout);
|
||||
}
|
||||
catch (const ScriptException& ex) {
|
||||
qCriticalNN << LOGSEC_CORE << "Custom script for generating feed file failed:" << QUOTE_W_SPACE_DOT(ex.message());
|
||||
qCriticalNN << LOGSEC_STANDARD << "Custom script for generating feed file failed:" << QUOTE_W_SPACE_DOT(ex.message());
|
||||
|
||||
throw FeedFetchException(Feed::Status::OtherError, ex.message());
|
||||
}
|
||||
|
@ -330,7 +330,7 @@ QList<Message> StandardServiceRoot::obtainNewMessages(Feed* feed,
|
|||
// stuff kicks in.
|
||||
if (SitemapParser::isGzip(feed_contents)) {
|
||||
#if defined(ENABLE_COMPRESSED_SITEMAP)
|
||||
qWarningNN << LOGSEC_CORE << "Decompressing gzipped feed data.";
|
||||
qWarningNN << LOGSEC_STANDARD << "Decompressing gzipped feed data.";
|
||||
|
||||
QByteArray uncompressed_feed_contents;
|
||||
|
||||
|
@ -340,12 +340,12 @@ QList<Message> StandardServiceRoot::obtainNewMessages(Feed* feed,
|
|||
|
||||
feed_contents = uncompressed_feed_contents;
|
||||
#else
|
||||
qWarningNN << LOGSEC_CORE << "This feed is gzipped.";
|
||||
qWarningNN << LOGSEC_STANDARD << "This feed is gzipped.";
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!f->postProcessScript().simplified().isEmpty()) {
|
||||
qDebugNN << LOGSEC_CORE << "We will process feed data with post-process script"
|
||||
qDebugNN << LOGSEC_STANDARD << "We will process feed data with post-process script"
|
||||
<< QUOTE_W_SPACE_DOT(f->postProcessScript());
|
||||
|
||||
try {
|
||||
|
@ -353,7 +353,7 @@ QList<Message> StandardServiceRoot::obtainNewMessages(Feed* feed,
|
|||
StandardFeed::postProcessFeedFileWithScript(f->postProcessScript(), feed_contents, download_timeout);
|
||||
}
|
||||
catch (const ScriptException& ex) {
|
||||
qCriticalNN << LOGSEC_CORE << "Post-processing script for feed file failed:" << QUOTE_W_SPACE_DOT(ex.message());
|
||||
qCriticalNN << LOGSEC_STANDARD << "Post-processing script for feed file failed:" << QUOTE_W_SPACE_DOT(ex.message());
|
||||
|
||||
throw FeedFetchException(Feed::Status::OtherError, ex.message());
|
||||
}
|
||||
|
@ -416,7 +416,7 @@ QList<Message> StandardServiceRoot::obtainNewMessages(Feed* feed,
|
|||
parser->setDontUseRawXmlSaving(f->dontUseRawXmlSaving());
|
||||
messages = parser->messages();
|
||||
|
||||
qDebugNN << LOGSEC_CORE << "XML parsing for feed" << QUOTE_W_SPACE(f->title()) << "took"
|
||||
qDebugNN << LOGSEC_STANDARD << "XML parsing for feed" << QUOTE_W_SPACE(f->title()) << "took"
|
||||
<< NONQUOTE_W_SPACE(tmr.elapsed()) << "ms.";
|
||||
|
||||
if (!parser->dateTimeFormat().isEmpty()) {
|
||||
|
@ -542,7 +542,7 @@ bool StandardServiceRoot::mergeImportExportModel(FeedsImportExportModel* model,
|
|||
else {
|
||||
some_feed_category_error = true;
|
||||
|
||||
qCriticalNN << LOGSEC_CORE << "Cannot import category:" << QUOTE_W_SPACE_DOT(ex.message());
|
||||
qCriticalNN << LOGSEC_STANDARD << "Cannot import category:" << QUOTE_W_SPACE_DOT(ex.message());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -567,7 +567,7 @@ bool StandardServiceRoot::mergeImportExportModel(FeedsImportExportModel* model,
|
|||
requestItemReassignment(new_feed, target_parent);
|
||||
}
|
||||
catch (const ApplicationException& ex) {
|
||||
qCriticalNN << LOGSEC_CORE << "Cannot import feed:" << QUOTE_W_SPACE_DOT(ex.message());
|
||||
qCriticalNN << LOGSEC_STANDARD << "Cannot import feed:" << QUOTE_W_SPACE_DOT(ex.message());
|
||||
some_feed_category_error = true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue