Skip to content

Commit

Permalink
Move configuration of logger into main func
Browse files Browse the repository at this point in the history
  • Loading branch information
madeddie committed May 10, 2024
1 parent a731f75 commit c79ad94
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions moocfi_cses.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@
import requests


logging.basicConfig(
level=logging.WARNING,
format="%(asctime)s %(levelname)s %(message)s",
datefmt="%Y-%m-%d %H:%M:%S",
)
logger = logging.getLogger(name="moocfi_cses")


@dataclass
Expand Down Expand Up @@ -298,6 +294,12 @@ def parse_task(html: str | bytes, task: Task) -> Task:
def main() -> None:
args = parse_args()

logging.basicConfig(
level=logging.WARNING,
format="%(asctime)s %(levelname)s %(message)s",
datefmt="%Y-%m-%d %H:%M:%S",
)

if args.cmd == "configure":
config = create_config()
write_config(args.config, config)
Expand Down

0 comments on commit c79ad94

Please sign in to comment.