Skip to content

Commit ffb3527

Browse files
author
gau1991
committed
Improved error handling, Added autocompletion for ee log
1 parent be9bfac commit ffb3527

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

config/bash_completion.d/ee_auto.rc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ _ee_complete()
5757
-- $cur) )
5858
;;
5959

60+
"log")
61+
COMPREPLY=( $(compgen \
62+
-W "--mysql --php --nginx --all" \
63+
-- $cur) )
64+
;;
65+
6066
# EVERYTHING ELSE
6167
*)
6268
;;

ee/cli/plugins/log.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,12 @@ def default(self):
5252
if self.app.pargs.mysql:
5353
# MySQL debug will not work for remote MySQL
5454
if EEVariables.ee_mysql_host is "localhost":
55-
open('/var/log/mysql/mysql-slow.log', 'a').close()
56-
self.msg = self.msg + ['/var/log/mysql/mysql-slow.log']
55+
if os.path.isfile('/var/log/mysql/mysql-slow.log'):
56+
self.msg = self.msg + ['/var/log/mysql/mysql-slow.log']
57+
else:
58+
Log.error(self, "Unable to find MySQL slow log file,"
59+
"Please generate it using commnad ee debug "
60+
"--mysql")
5761
else:
5862
Log.warn(self, "Remote MySQL found, EasyEngine is not able to"
5963
"show MySQL log file")

0 commit comments

Comments
 (0)