File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 2525import logging
2626
2727
28- class CustomFormatter (logging .Formatter ):
28+ class PyAnsysBaseFormatter (logging .Formatter ):
2929 """Custom formatter to truncate long columns."""
3030
3131 def set_column_width (self , width : int ):
@@ -56,7 +56,7 @@ def format(self, record):
5656 return super ().format (record )
5757
5858
59- DEFAULT_FORMATTER = CustomFormatter (
59+ DEFAULT_FORMATTER = PyAnsysBaseFormatter (
6060 "%(asctime)s [%(levelname)-8s | %(module)s | %(funcName)s:%(lineno)-4d] > %(message)s"
6161)
6262DEFAULT_FORMATTER .set_column_width (15 )
Original file line number Diff line number Diff line change 2626import pytest
2727
2828from ansys .tools .common .logger import LOGGER , Logger
29- from ansys .tools .common .logger_formatter import CustomFormatter
29+ from ansys .tools .common .logger_formatter import PyAnsysBaseFormatter
3030
3131
3232def test_logger_singleton ():
@@ -69,8 +69,8 @@ def test_logger_file_handler(tmp_path):
6969
7070
7171def test_custom_formatter_truncation ():
72- """Test truncation of module and function names in CustomFormatter ."""
73- formatter = CustomFormatter ("%(module)s | %(funcName)s" )
72+ """Test truncation of module and function names in PyAnsysBaseFormatter ."""
73+ formatter = PyAnsysBaseFormatter ("%(module)s | %(funcName)s" )
7474 assert formatter .max_column_width == 15 # Default width
7575 formatter .set_column_width (10 )
7676 record = logging .LogRecord (
@@ -90,8 +90,8 @@ def test_custom_formatter_truncation():
9090
9191
9292def test_custom_formatter_column_width ():
93- """Test setting and getting column width in CustomFormatter ."""
94- formatter = CustomFormatter ("%(module)s | %(funcName)s" )
93+ """Test setting and getting column width in PyAnsysBaseFormatter ."""
94+ formatter = PyAnsysBaseFormatter ("%(module)s | %(funcName)s" )
9595 formatter .set_column_width (12 )
9696 assert formatter .max_column_width == 12
9797
You can’t perform that action at this time.
0 commit comments