ListedSubWindow: Switch to logging.

results
Pierre-Antoine Rouby 2023-07-05 16:53:33 +02:00
parent e925a95987
commit c1b3d42a6a
1 changed files with 5 additions and 2 deletions

View File

@ -1,7 +1,10 @@
# -*- coding: utf-8 -*-
import logging
from functools import reduce
logger = logging.getLogger()
class ListedSubWindow(object):
def __init__(self):
super(ListedSubWindow, self).__init__()
@ -17,7 +20,7 @@ class ListedSubWindow(object):
def sub_win_add(self, name, win):
self.sub_win_list.append((name, win))
self.sub_win_cnt += 1
print(f"+ {name} ({self.sub_win_cnt})")
logger.info(f"Open window: {name} ({self.sub_win_cnt})")
def sub_win_del(self, name):
self.sub_win_list = list(
@ -27,7 +30,7 @@ class ListedSubWindow(object):
)
)
self.sub_win_cnt = len(self.sub_win_list)
print(f"- {name} ({self.sub_win_cnt})")
logger.info(f"Close window: {name} ({self.sub_win_cnt})")
def sub_win_exists(self, name):
return reduce(