@@ -182,16 +182,24 @@ def filter(self,
182
182
183
183
184
184
def get_handlers (log_console = True ,
185
+ log_level_console = defaults .LOG_LEVEL ,
185
186
log_file_class = None ,
186
187
log_file_options = None ,
187
- log_level = defaults .LOG_LEVEL ):
188
+ log_level_file = defaults .LOG_LEVEL ):
188
189
"""Get the handlers to use when logging.
189
190
190
191
Parameters
191
192
----------
192
193
log_console : ``bool``, ``True``
193
194
Whether to write log messages to the console.
194
195
196
+ log_level_console : ``str``, ``bulkDGD.defaults.LOG_LEVEL``
197
+ The level below which log messages will not be logged on the
198
+ console.
199
+
200
+ By default, it takes the value of
201
+ ``bulkDGD.defaults.LOG_LEVEL``.
202
+
195
203
log_file_class : ``logging.FileHandler``, optional
196
204
A ``FileHandler`` class to construct the handler that will
197
205
log to a file.
@@ -205,8 +213,9 @@ def get_handlers(log_console = True,
205
213
206
214
It must be provided if ``log_file_class`` is provided.
207
215
208
- log_level : ``str``, ``bulkDGD.defaults.LOG_LEVEL``
209
- The level below which log messages will be ignored.
216
+ log_level_file : ``str``, ``bulkDGD.defaults.LOG_LEVEL``
217
+ The level below which log messages will not be logged to the
218
+ file.
210
219
211
220
By default, it takes the value of
212
221
``bulkDGD.defaults.LOG_LEVEL``.
@@ -229,7 +238,7 @@ def get_handlers(log_console = True,
229
238
handler = log .StreamHandler ()
230
239
231
240
# Set the handler's level.
232
- handler .setLevel (log_level )
241
+ handler .setLevel (log_level_console )
233
242
234
243
# Add the handler to the list of handlers.
235
244
handlers .append (handler )
@@ -275,7 +284,7 @@ def get_handlers(log_console = True,
275
284
handler = log_file_class (** log_file_options )
276
285
277
286
# Set the handler's level.
278
- handler .setLevel (log_level )
287
+ handler .setLevel (log_level_file )
279
288
280
289
# Add the handler to the list of handlers.
281
290
handlers .append (handler )
0 commit comments