Added default values to the logging function
This commit is contained in:
parent
e3d6087ed4
commit
435356c321
@ -58,7 +58,7 @@ def search(docopt_arguments, source_loader):
|
|||||||
:param source_loader: An initiated SourceLoader object pointed at the directory with the sources.
|
:param source_loader: An initiated SourceLoader object pointed at the directory with the sources.
|
||||||
"""
|
"""
|
||||||
conf = Configurator()
|
conf = Configurator()
|
||||||
conf.start_log(docopt_arguments["--log"], docopt_arguments["-v"])
|
conf.set_logging(docopt_arguments["--log"], docopt_arguments["-v"])
|
||||||
conf.set_output(docopt_arguments["--output"], docopt_arguments["--format"])
|
conf.set_output(docopt_arguments["--output"], docopt_arguments["--format"])
|
||||||
setup_crawler(docopt_arguments["<compound>"], conf.scrapy_settings, source_loader, docopt_arguments["--attributes"].split(','))
|
setup_crawler(docopt_arguments["<compound>"], conf.scrapy_settings, source_loader, docopt_arguments["--attributes"].split(','))
|
||||||
log.start(conf.scrapy_settings.get("LOG_FILE"), conf.scrapy_settings.get("LOG_LEVEL"), conf.scrapy_settings.get("LOG_STDOUT"))
|
log.start(conf.scrapy_settings.get("LOG_FILE"), conf.scrapy_settings.get("LOG_LEVEL"), conf.scrapy_settings.get("LOG_STDOUT"))
|
||||||
|
@ -32,7 +32,7 @@ class Configurator:
|
|||||||
self.scrapy_settings.overrides["FEED_FORMAT"] = fileformat
|
self.scrapy_settings.overrides["FEED_FORMAT"] = fileformat
|
||||||
|
|
||||||
|
|
||||||
def set_logging(self, logfile, verbose):
|
def set_logging(self, logfile=None, verbose=0):
|
||||||
"""
|
"""
|
||||||
This function changes the default settings of Scapy's logging functionality
|
This function changes the default settings of Scapy's logging functionality
|
||||||
using the settings given by the CLI.
|
using the settings given by the CLI.
|
||||||
|
Reference in New Issue
Block a user