@@ -69,6 +69,7 @@ def __init__(self):
69
69
'ids_to_floats' : 'False' ,
70
70
'label_col' : 'y' ,
71
71
'log' : '' ,
72
+ 'logs' : '' ,
72
73
'learning_curve_cv_folds_list' : '[]' ,
73
74
'learning_curve_train_sizes' : '[]' ,
74
75
'min_feature_count' : '1' ,
@@ -113,6 +114,7 @@ def __init__(self):
113
114
'ids_to_floats' : 'Input' ,
114
115
'label_col' : 'Input' ,
115
116
'log' : 'Output' ,
117
+ 'logs' : 'Output' ,
116
118
'learning_curve_cv_folds_list' : 'Input' ,
117
119
'learning_curve_train_sizes' : 'Input' ,
118
120
'min_feature_count' : 'Tuning' ,
@@ -398,8 +400,22 @@ def parse_config_file(config_path, log_level=logging.INFO): # noqa: C901
398
400
# next, get the log path before anything else since we need to
399
401
# save all logging messages to a log file in addition to displaying
400
402
# them on the console
403
+
404
+ # if the user specified "log" instead of "logs", we need
405
+ # to show a warning and save its value in "logs" instead
406
+ log_value = config .get ("Output" , "log" )
407
+ show_log_warning = False
408
+ if log_value :
409
+ # since we do not have a logger yet, we will show the warning later
410
+ show_log_warning = True
411
+ config .set ('Output' , 'logs' , log_value )
412
+ config .remove_option ('Output' , 'log' )
413
+
414
+ # now get the value from the 'logs' field
415
+ log_value = config .get ("Output" , "logs" )
416
+
401
417
try :
402
- log_path = locate_file (config . get ( "Output" , "log" ) , config_dir )
418
+ log_path = locate_file (log_value , config_dir )
403
419
except IOError as e :
404
420
if e .errno == errno .ENOENT :
405
421
log_path = e .filename
@@ -416,6 +432,13 @@ def parse_config_file(config_path, log_level=logging.INFO): # noqa: C901
416
432
filepath = main_log_file ,
417
433
log_level = log_level )
418
434
435
+ # now show the 'log' warning, if any, since we have the logger set up
436
+ if show_log_warning :
437
+ logger .warning ("The 'log' option in the [Output] section is deprecated "
438
+ "and will be removed in the next version. Use 'logs' "
439
+ "instead." )
440
+ show_log_warning = False
441
+
419
442
if config .has_option ("General" , "task" ):
420
443
task = config .get ("General" , "task" )
421
444
else :
0 commit comments