Browse Source

Improved error handling, Added autocompletion for ee log

bugfixes
gau1991 10 years ago
parent
commit
ffb35276c1
  1. 6
      config/bash_completion.d/ee_auto.rc
  2. 8
      ee/cli/plugins/log.py

6
config/bash_completion.d/ee_auto.rc

@ -57,6 +57,12 @@ _ee_complete()
-- $cur) )
;;
"log")
COMPREPLY=( $(compgen \
-W "--mysql --php --nginx --all" \
-- $cur) )
;;
# EVERYTHING ELSE
*)
;;

8
ee/cli/plugins/log.py

@ -52,8 +52,12 @@ class EELogController(CementBaseController):
if self.app.pargs.mysql:
# MySQL debug will not work for remote MySQL
if EEVariables.ee_mysql_host is "localhost":
open('/var/log/mysql/mysql-slow.log', 'a').close()
self.msg = self.msg + ['/var/log/mysql/mysql-slow.log']
if os.path.isfile('/var/log/mysql/mysql-slow.log'):
self.msg = self.msg + ['/var/log/mysql/mysql-slow.log']
else:
Log.error(self, "Unable to find MySQL slow log file,"
"Please generate it using commnad ee debug "
"--mysql")
else:
Log.warn(self, "Remote MySQL found, EasyEngine is not able to"
"show MySQL log file")

Loading…
Cancel
Save