Skip to content

Commit

Permalink
Resolves #770.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjordan committed Apr 16, 2024
1 parent 2fb0c82 commit 19ffa9c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
1 change: 1 addition & 0 deletions WorkbenchConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ def get_default_config(self):
"log_response_status_code": False,
"log_headers": False,
"log_term_creation": True,
"log_file_name_and_line_number": False,
"progress_bar": False,
"user_agent": "Islandora Workbench",
"allow_redirects": True,
Expand Down
23 changes: 16 additions & 7 deletions workbench
Original file line number Diff line number Diff line change
Expand Up @@ -3357,13 +3357,22 @@ if config["secondary_tasks"] is not None and len(config["secondary_tasks"]) > 0:
for handler in logging.root.handlers[:]:
logging.root.removeHandler(handler)

logging.basicConfig(
filename=config["log_file_path"],
level=logging.INFO,
filemode=config["log_file_mode"],
format="%(asctime)s - %(levelname)s - %(message)s",
datefmt="%d-%b-%y %H:%M:%S",
)
if config["log_file_name_and_line_number"] is True:
logging.basicConfig(
filename=config["log_file_path"],
level=logging.INFO,
filemode=config["log_file_mode"],
format="%(asctime)s - %(levelname)s - %(filename)s - %(lineno)d - %(message)s",
datefmt="%d-%b-%y %H:%M:%S",
)
else:
logging.basicConfig(
filename=config["log_file_path"],
level=logging.INFO,
filemode=config["log_file_mode"],
format="%(asctime)s - %(levelname)s - %(message)s",
datefmt="%d-%b-%y %H:%M:%S",
)

if "check" in config.keys():
tasks_to_skip = ["create_from_files", "get_data_from_view"]
Expand Down

0 comments on commit 19ffa9c

Please sign in to comment.