Skip to content

Commit

Permalink
set max width for the logger
Browse files Browse the repository at this point in the history
  • Loading branch information
erdogant committed Mar 2, 2025
1 parent 355bb7d commit be719b2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion distfit/distfit.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@
import warnings
warnings.filterwarnings('ignore')

NAME_WIDTH = max(len(__name__), 12) # Ensuring a minimum width of 12
logger = logging.getLogger('')
[logger.removeHandler(handler) for handler in logger.handlers[:]]
logging.basicConfig(
format="%(asctime)s [%(name)-12s] > %(levelname)-8s > %(message)s",
format=f"%(asctime)s [%(name)-{NAME_WIDTH}s]> %(levelname)-8s> %(message)s",
datefmt="%d-%m-%y %H:%M:%S",
level=logging.INFO)
logger = logging.getLogger(__name__)
Expand Down

0 comments on commit be719b2

Please sign in to comment.