From 63720ffa0fc1c0960d3f01612f9dfa83f92720c3 Mon Sep 17 00:00:00 2001 From: Michael Joyce Date: Thu, 19 Jan 2023 14:44:58 -0800 Subject: [PATCH] Issue #491 - Add logger type annotations for GUI mypy checks Add minor type annotations in log.py to keep type checking happy in AIT-GUI. Resolve #491 --- ait/core/log.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ait/core/log.py b/ait/core/log.py index 56672ee5..d94faeb2 100644 --- a/ait/core/log.py +++ b/ait/core/log.py @@ -23,6 +23,7 @@ import socket import datetime import time +from typing import Callable, Optional import logging import logging.handlers @@ -316,10 +317,10 @@ def notice(*args, **kwargs): # type `Any` addresses mypy issues where log calls are marked as # "None" being not callable. logger = None -crit = None -debug = None -error = None -info = None -warn = None +crit: Optional[Callable[[str], str]] = None +debug: Optional[Callable[[str], str]] = None +error: Optional[Callable[[str], str]] = None +info: Optional[Callable[[str], str]] = None +warn: Optional[Callable[[str], str]] = None init()