Fix: Fixes logging setup
This commit is contained in:
parent
2d7635db89
commit
ea8628c527
2 changed files with 10 additions and 6 deletions
|
|
@ -468,16 +468,20 @@ def graph_to_tuple(graph):
|
|||
|
||||
|
||||
def setup_logging(log_level=logging.INFO):
|
||||
"""This method sets up the logging configuration."""
|
||||
"""Sets up the logging configuration."""
|
||||
formatter = logging.Formatter("%(asctime)s - %(levelname)s - %(message)s\n")
|
||||
|
||||
stream_handler = logging.StreamHandler(sys.stdout)
|
||||
stream_handler.setFormatter(formatter)
|
||||
stream_handler.setLevel(log_level)
|
||||
|
||||
logging.basicConfig(
|
||||
level=log_level,
|
||||
handlers=[stream_handler],
|
||||
)
|
||||
root_logger = logging.getLogger()
|
||||
|
||||
if root_logger.hasHandlers():
|
||||
root_logger.handlers.clear()
|
||||
|
||||
root_logger.addHandler(stream_handler)
|
||||
root_logger.setLevel(log_level)
|
||||
|
||||
|
||||
# ---------------- Example Usage ----------------
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ async def main(enable_steps):
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
setup_logging(logging.INFO)
|
||||
setup_logging(logging.ERROR)
|
||||
|
||||
rebuild_kg = True
|
||||
retrieve = True
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue