python 怎么像shell -x 一样追踪脚本运行过程
python 怎么像shell -x 一样追踪脚本运行过程
[root@localhost keepalived]# python -m trace --trace mysql_start.py
--- modulename: threading, funcname: settrace
threading.py(90): _trace_hook = func
--- modulename: mysql_start, funcname: <module>
mysql_start.py(7): import os
mysql_start.py(8): mysqlpath = '/opt/soft/mysql-5.6.13'
mysql_start.py(9): mysql_conf = "/opt/soft/mysql-5.6.13/my.cnf"
mysql_start.py(10): mysql_ex = 'cd %s && ./bin/mysqld_safe --defaults-file=%s &' %(mysqlpath,mysql_conf)
mysql_start.py(11): os.system(mysql_ex)
[root@localhost keepalived]# 190708 11:28:19 mysqld_safe Logging to '/var/log/mysqld.log'.
190708 11:28:19 mysqld_safe Starting mysqld daemon with databases from /opt/soft/mysql-5.6.13/data
改行去放羊