@@ -110,7 +110,7 @@ def test_decorator_output(self):
110110            settings .secure_logger_logging_level  +  ":decorator_logger:secure_logger: tests.mock_decorated_def() " 
111111            "['<tests.TestModuleDefDecorator testMethod=test_decorator_output>', "  +  hello_world 
112112        )
113-         with  self .assertLogs (level = settings .logger_level ) as  cm :
113+         with  self .assertLogs (logger = settings . logger_name ,  level = settings .logger_level ) as  cm :
114114            self .mock_decorated_def ("hello world" )
115115
116116        self .assertEqual (cm .output [0 ][0 :100 ], expected_output [0 :100 ])
@@ -126,7 +126,12 @@ class MockClass:
126126        def  decorator_with_defaults (self , test_dict , test_list ):
127127            """Test class input parameter as objects.""" 
128128
129-         @secure_logger (sensitive_keys = ["aws_secret_access_key" ], indent = 10 , message = "-- Forbidden! --" ) 
129+         @secure_logger ( 
130+             log_level = "INFO" , 
131+             sensitive_keys = ["aws_secret_access_key" ], 
132+             indent = 10 , 
133+             message = "-- Forbidden! --" , 
134+         ) 
130135        def  decorator_with_custom_params (self , test_dict , test_list ):
131136            """Test class input parameter as objects.""" 
132137
@@ -145,11 +150,22 @@ def test_class_method_with_default_params(self):
145150            "['<tests.TestClassMethodDecorator.MockClass" 
146151        )
147152
148-         with  self .assertLogs (level = settings .logger_level ) as  cm :
153+         with  self .assertLogs (logger = settings . logger_name ,  level = settings .logger_level ) as  cm :
149154            self .mock_class .decorator_with_defaults (self .test_dict , self .test_list )
150155
151156        self .assertEqual (cm .output [0 ][0 :100 ], expected_output [0 :100 ])
152157
158+     def  test_class_method_with_custom_params (self ):
159+         """Test class method with default parameters.""" 
160+         expected_output  =  (
161+             "INFO:decorator_logger:secure_logger: tests.decorator_with_custom_params() " 
162+             "['<tests.TestClassMethodDecorator.MockClass" 
163+         )
164+         with  self .assertLogs (logger = settings .logger_name ) as  cm :
165+             self .mock_class .decorator_with_custom_params (self .test_dict , self .test_list )
166+ 
167+         self .assertEqual (cm .output [0 ][0 :100 ], expected_output [0 :100 ])
168+ 
153169
154170class  TestClassDecorator (unittest .TestCase ):
155171    """Test class logging.""" 
0 commit comments