Include sys.argv in debug report
This commit is contained in:
parent
2f720210e9
commit
5d40d74c46
1 changed files with 10 additions and 13 deletions
|
|
@ -175,25 +175,22 @@ def get_log_filepath():
|
||||||
def generate_debug_report():
|
def generate_debug_report():
|
||||||
"""Generate debug report with various runtime details, returns str."""
|
"""Generate debug report with various runtime details, returns str."""
|
||||||
import socket
|
import socket
|
||||||
report = []
|
platform_function_list = (
|
||||||
func_list = (
|
|
||||||
'architecture',
|
'architecture',
|
||||||
'machine',
|
'machine',
|
||||||
'platform',
|
'platform',
|
||||||
'python_version',
|
'python_version',
|
||||||
)
|
)
|
||||||
|
report = []
|
||||||
|
|
||||||
# Platform
|
# System
|
||||||
report.append('[Platform]')
|
report.append('[System]')
|
||||||
report.append(' {:<24} {}'.format(
|
report.append(' {:<24} {}'.format('FQDN', socket.getfqdn()))
|
||||||
'FQDN',
|
for func in platform_function_list:
|
||||||
socket.getfqdn(),
|
func_name = func.replace('_', ' ').capitalize()
|
||||||
))
|
func_result = getattr(platform, func)()
|
||||||
for func in func_list:
|
report.append(' {:<24} {}'.format(func_name, func_result))
|
||||||
report.append(' {:<24} {}'.format(
|
report.append(' {:<24} {}'.format('Python sys.argv', sys.argv))
|
||||||
func.replace('_', ' ').title(),
|
|
||||||
getattr(platform, func)(),
|
|
||||||
))
|
|
||||||
report.append('')
|
report.append('')
|
||||||
|
|
||||||
# Environment
|
# Environment
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue