@@ -130,6 +130,7 @@ def add_deprecated_params(parser):
130130 group .add_argument ('--disable_numactl' , action = 'store_true' , default = False , help = 'Deprecated by --multi-task-manager.' )
131131 group .add_argument ('--disable_taskset' , action = 'store_true' , default = False , help = 'Deprecated by --multi-task-manager.' )
132132 group .add_argument ('--disable_iomp' , action = 'store_true' , default = False , help = 'Deprecated by --omp-runtime.' )
133+ group .add_argument ('--log_path' , type = str , default = '' , help = 'Deprecated by --log-dir.' )
133134 group .add_argument ('--multi_instance' , action = 'store_true' , default = False , help = 'Deprecated. Will be removed.' )
134135 group .add_argument ('--distributed' , action = 'store_true' , default = False , help = 'Deprecated. Will be removed.' )
135136
@@ -155,6 +156,9 @@ def process_deprecated_params(args, logger):
155156 if args .use_logical_core :
156157 logger .warning ('Argument --use_logical_core is deprecated by --use-logical-cores.' )
157158 args .use_logical_cores = args .use_logical_core
159+ if args .log_path != '' :
160+ logger .warning ('Argument --log_path is deprecated by --log-dir.' )
161+ args .log_dir = args .log_path
158162
159163 if args .multi_instance :
160164 logger .info ('Argument --multi_instance is deprecated. Will be removed. If you are using the deprecated argument, please update it to the new one.' )
@@ -251,8 +255,8 @@ def parse_args():
251255 )
252256
253257 parser .add_argument (
254- '--log-path ' ,
255- '--log_path ' ,
258+ '--log-dir ' ,
259+ '--log_dir ' ,
256260 default = '' ,
257261 type = str ,
258262 help = 'The log file directory. Setting it to empty disables logging to files.' ,
@@ -299,14 +303,14 @@ def main():
299303
300304 args = parser .parse_args ()
301305 process_deprecated_params (args , logger )
302- if args .log_path :
303- path = os .path .dirname (args .log_path if args .log_path .endswith ('/' ) else f'{ args .log_path } /' )
306+ if args .log_dir :
307+ path = os .path .dirname (args .log_dir if args .log_dir .endswith ('/' ) else f'{ args .log_dir } /' )
304308 if not os .path .exists (path ):
305309 os .makedirs (path )
306- args .log_path = path
310+ args .log_dir = path
307311
308312 args .log_file_prefix = f'{ args .log_file_prefix } _{ datetime .now ().strftime ("%Y%m%d%H%M%S" )} '
309- fileHandler = logging .FileHandler (f'{ args .log_path } /{ args .log_file_prefix } _instances.log' )
313+ fileHandler = logging .FileHandler (f'{ args .log_dir } /{ args .log_file_prefix } _instances.log' )
310314 logFormatter = logging .Formatter (format_str )
311315 fileHandler .setFormatter (logFormatter )
312316 logger .addHandler (fileHandler )
0 commit comments