Skip to content

Commit

Permalink
Change logging from FileHandler() to StreamHandler() on stdout
Browse files Browse the repository at this point in the history
This allows for the logs to be output in the terminal, which is helpful when running CHILLED on UniCC.
  • Loading branch information
measrainsey committed Oct 31, 2024
1 parent b7bd7f2 commit 8d340e9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion message_ix_buildings/chilled/util/common.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import sys
from pathlib import Path


Expand All @@ -11,7 +12,7 @@ def get_logger(name: str):
log.setLevel(logging.INFO)

# configure the handler and formatter as needed
handler = logging.FileHandler(f"{name}.log", mode="w")
handler = logging.StreamHandler(sys.stdout)
formatter = logging.Formatter("%(name)s %(asctime)s %(levelname)s %(message)s")

# add formatter to the handler
Expand Down

0 comments on commit 8d340e9

Please sign in to comment.