Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(804)

Unified Diff: components/dom_distiller/standalone/content_extractor.cc

Issue 302793002: Configure DomDistiller debug output. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add comment Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/dom_distiller/dom_distiller_service_factory.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/dom_distiller/standalone/content_extractor.cc
diff --git a/components/dom_distiller/standalone/content_extractor.cc b/components/dom_distiller/standalone/content_extractor.cc
index dd694959a9cb9bb570278b7642ee9449f16143b3..e851a711e75c95a2a25941d52c1ca78dfd84cea6 100644
--- a/components/dom_distiller/standalone/content_extractor.cc
+++ b/components/dom_distiller/standalone/content_extractor.cc
@@ -9,6 +9,7 @@
#include "base/message_loop/message_loop.h"
#include "base/path_service.h"
#include "base/run_loop.h"
+#include "base/strings/string_number_conversions.h"
#include "components/dom_distiller/content/distiller_page_web_contents.h"
#include "components/dom_distiller/core/distiller.h"
#include "components/dom_distiller/core/dom_distiller_database.h"
@@ -44,8 +45,12 @@ const char* kOutputFile = "output-file";
// output.
const char* kShouldOutputBinary = "output-binary";
+// Indicates to output only the text of the article and not the enclosing html.
const char* kExtractTextOnly = "extract-text-only";
+// Indicates to include debug output.
+const char* kDebugLevel = "debug-level";
+
scoped_ptr<DomDistillerService> CreateDomDistillerService(
content::BrowserContext* context,
const base::FilePath& db_path) {
@@ -69,6 +74,14 @@ scoped_ptr<DomDistillerService> CreateDomDistillerService(
if (base::CommandLine::ForCurrentProcess()->HasSwitch(kExtractTextOnly)) {
options.set_extract_text_only(true);
}
+ int debug_level = 0;
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(kDebugLevel) &&
+ base::StringToInt(
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ kDebugLevel),
+ &debug_level)) {
+ options.set_debug_level(debug_level);
+ }
scoped_ptr<DistillerFactory> distiller_factory(
new DistillerFactoryImpl(distiller_url_fetcher_factory.Pass(), options));
« no previous file with comments | « chrome/browser/dom_distiller/dom_distiller_service_factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698