ignore UserWarning; ignore flaskwebgui log

This commit is contained in:
Qing 2022-10-24 18:29:33 +08:00
parent b00af182de
commit 476159bbe5
2 changed files with 4 additions and 2 deletions

View File

@ -1,7 +1,9 @@
import warnings
warnings.simplefilter("ignore", UserWarning)
from lama_cleaner.parse_args import parse_args
from lama_cleaner.server import main
def entry_point():
args = parse_args()
main(args)

View File

@ -57,7 +57,7 @@ BUILD_DIR = os.environ.get("LAMA_CLEANER_BUILD_DIR", "app/build")
class NoFlaskwebgui(logging.Filter):
def filter(self, record):
return "GET //flaskwebgui-keep-server-alive" not in record.getMessage()
return "GET /flaskwebgui-keep-server-alive" not in record.getMessage()
logging.getLogger("werkzeug").addFilter(NoFlaskwebgui())