Include sys.argv in debug report

This commit is contained in:
2Shirt 2019-08-06 21:10:13 -06:00
parent 2f720210e9
commit 5d40d74c46
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -175,25 +175,22 @@ def get_log_filepath():
def generate_debug_report():
"""Generate debug report with various runtime details, returns str."""
import socket
report = []
func_list = (
platform_function_list = (
'architecture',
'machine',
'platform',
'python_version',
)
report = []
# Platform
report.append('[Platform]')
report.append(' {:<24} {}'.format(
'FQDN',
socket.getfqdn(),
))
for func in func_list:
report.append(' {:<24} {}'.format(
func.replace('_', ' ').title(),
getattr(platform, func)(),
))
# System
report.append('[System]')
report.append(' {:<24} {}'.format('FQDN', socket.getfqdn()))
for func in platform_function_list:
func_name = func.replace('_', ' ').capitalize()
func_result = getattr(platform, func)()
report.append(' {:<24} {}'.format(func_name, func_result))
report.append(' {:<24} {}'.format('Python sys.argv', sys.argv))
report.append('')
# Environment