Skip to content
Snippets Groups Projects
Commit 88eae717 authored by Ann-Kathrin Margarete Edrich's avatar Ann-Kathrin Margarete Edrich
Browse files

SHIRE version 1.0

parent d4ae7c20
Branches
No related tags found
No related merge requests found
Showing
with 3257 additions and 0 deletions
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import logging
def save_log(path):
"""
Initialisation of a log file using the python package logging to store
information, warnings and errors
Input:
path: Path where to store the log file
Output:
logger: Logger
"""
path_log = os.path.dirname(path)
logger = logging.getLogger()
logger.setLevel(logging.INFO)
formatter = logging.Formatter(
'%(asctime)s | %(levelname)s | %(message)s')
file_handler = logging.FileHandler(path)
file_handler.setLevel(logging.DEBUG)
file_handler.setFormatter(formatter)
logger.addHandler(file_handler)
return logger
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment