Skip to content
Snippets Groups Projects

ENH: enable logging for commandline use

Merged Henrik tom Wörden requested to merge f-logging into dev
Files
2
+ 11
3
@@ -1550,11 +1550,19 @@ def crawler_main(crawled_directory_path: str,
try:
crawler = Crawler(securityMode=securityMode)
# setup logging and reporting if serverside execution
if "SHARED_DIR" in os.environ:
if "SHARED_DIR" in os.environ: # setup logging and reporting if serverside execution
userlog_public, htmluserlog_public, debuglog_public = configure_server_side_logging()
# TODO make this optional
_create_status_record(
get_config_setting("public_host_url") + "/Shared/" + htmluserlog_public, crawler.run_id)
get_config_setting("public_host_url") + "/Shared/" + htmluserlog_public,
crawler.run_id)
else: # setup stdout logging for other cases
root_logger = logging.getLogger()
root_logger.setLevel(level=(logging.DEBUG if debug else logging.INFO))
handler = logging.StreamHandler(stream=sys.stdout)
handler.setLevel(logging.DEBUG if debug else logging.INFO)
root_logger.addHandler(handler)
logger.handlers.clear()
debug_tree = DebugTree()
crawled_data = scan_directory(
Loading