Skip to content

Commit b124feb

Browse files
committed
增加gas_query日志的查看功能
1 parent 3086b89 commit b124feb

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

log_console/command_helper.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,13 @@ def excute2(cmd_id, queryStr, reversed=False):
103103
"""
104104
config = ConfigParser.RawConfigParser(allow_no_value=True)
105105
config.read('console.ini')
106-
cmd = config.get('cmd', cmd_id) + ' ' + queryStr
106+
cmd = config.get('cmd', cmd_id)
107+
108+
if not os.access(cmd, os.F_OK):
109+
cmd = 'ls -l'
110+
elif len(queryStr) > 0:
111+
cmd = cmd + ' ' + queryStr
112+
107113
(cmd, cost, out, err) = CommandUtil.excute(cmd)
108114

109115
raws = out.split('\n')

log_console/supervisor_console.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
;bash -c 'source /home/liyan/console/env/bin/activate; python /home/liyan/console/web_console.py'
44
command=/srv/www/console/env/bin/python /srv/www/console/web_console.py
55
directory=/srv/www/console
6-
environment=PATH="/srv/www/console/env/bin:/usr/bin:/usr/local/bin"
6+
environment=PATH="/srv/www/console/env/bin:bin:/usr/bin:/usr/local/bin"
77
user=nobody
88
stdout_logfile=/var/log/supervisor/%(program_name)s.log
99
stdout_logfile_maxbytes=1MB
1010
stdout_logfile_backups=2
1111
stderr_logfile=/var/log/supervisor/%(program_name)s_errors.log
1212
stderr_logfile_maxbytes=1MB
13-
stderr_logfile_backups=2
13+
stderr_logfile_backups=2

log_console/templates/gas.html

+1-3
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@
5151
<tbody>
5252
{% for record in result.raws %}
5353
<tr>
54-
{% for cell in record %}
55-
<td class="blue">{{ cell }}</td>
56-
{% endfor %}
54+
<td class="blue">{{ record }}</td>
5755
</tr>
5856
{% endfor %}
5957
</tbody>

0 commit comments

Comments
 (0)