diff --git a/projects/amdsmi/amdsmi_cli/amdsmi_commands.py b/projects/amdsmi/amdsmi_cli/amdsmi_commands.py index 7ea9ae2573..16823c4b20 100644 --- a/projects/amdsmi/amdsmi_cli/amdsmi_commands.py +++ b/projects/amdsmi/amdsmi_cli/amdsmi_commands.py @@ -115,9 +115,15 @@ class AMDSMICommands(): self.logger.output['rocm_version'] = f'{rocm_version_str}' if self.logger.is_human_readable_format(): - print(f'AMDSMI Tool: {__version__} | '\ - f'AMDSMI Library version: {amdsmi_lib_version_str} | ' \ - f'ROCm version: {rocm_version_str}') + human_readable_output = f"AMDSMI Tool: {__version__} | " \ + f"AMDSMI Library version: {amdsmi_lib_version_str} | " \ + f"ROCm version: {rocm_version_str}" + # Custom human readable handling for version + if self.logger.destination == 'stdout': + print(human_readable_output) + else: + with self.logger.destination.open('a') as output_file: + output_file.write(human_readable_output + '\n') elif self.logger.is_json_format() or self.logger.is_csv_format(): self.logger.print_output() diff --git a/projects/amdsmi/amdsmi_cli/amdsmi_logger.py b/projects/amdsmi/amdsmi_cli/amdsmi_logger.py index c0ffe5a8fb..b54d669897 100644 --- a/projects/amdsmi/amdsmi_cli/amdsmi_logger.py +++ b/projects/amdsmi/amdsmi_cli/amdsmi_logger.py @@ -465,7 +465,7 @@ class AMDSMILogger(): self._print_tabular_output(multiple_device_enabled=multiple_device_enabled, watching_output=watching_output) else: self._print_human_readable_output(multiple_device_enabled=multiple_device_enabled, - watching_output=watching_output) + watching_output=watching_output) def _print_json_output(self, multiple_device_enabled=False, watching_output=False):