Add support for tail-log in launcher menu
This commit is contained in:
parent
4cb3fc7012
commit
f9c35eb23a
1 changed files with 9 additions and 4 deletions
|
|
@ -316,8 +316,9 @@ MENU = \
|
||||||
| 6) Kill Portal + Server (send kill signal to process) |
|
| 6) Kill Portal + Server (send kill signal to process) |
|
||||||
| 7) Kill Server only |
|
| 7) Kill Server only |
|
||||||
+--- Information -----------------------------------------------+
|
+--- Information -----------------------------------------------+
|
||||||
| 8) Run status |
|
| 8) Tail log file
|
||||||
| 9) Port info |
|
| 9) Run status |
|
||||||
|
| 10) Port info |
|
||||||
+---------------------------------------------------------------+
|
+---------------------------------------------------------------+
|
||||||
| h) Help i) About info q) Abort |
|
| h) Help i) About info q) Abort |
|
||||||
+---------------------------------------------------------------+"""
|
+---------------------------------------------------------------+"""
|
||||||
|
|
@ -938,7 +939,6 @@ def tail_server_log(filename, rate=1):
|
||||||
new_size = os.path.getsize(filename)
|
new_size = os.path.getsize(filename)
|
||||||
return new_size != prev_size, new_size
|
return new_size != prev_size, new_size
|
||||||
|
|
||||||
|
|
||||||
def _get_new_lines(filehandle, old_linecount):
|
def _get_new_lines(filehandle, old_linecount):
|
||||||
"count lines, get the ones not counted before"
|
"count lines, get the ones not counted before"
|
||||||
|
|
||||||
|
|
@ -1661,8 +1661,13 @@ def run_menu():
|
||||||
elif inp == 7:
|
elif inp == 7:
|
||||||
kill(SERVER_PIDFILE, 'Server')
|
kill(SERVER_PIDFILE, 'Server')
|
||||||
elif inp == 8:
|
elif inp == 8:
|
||||||
query_status()
|
if not SERVER_LOGFILE:
|
||||||
|
init_game_directory(CURRENT_DIR, check_db=False)
|
||||||
|
tail_server_log(SERVER_LOGFILE)
|
||||||
|
print(" Tailing logfile {} ...".format(SERVER_LOGFILE))
|
||||||
elif inp == 9:
|
elif inp == 9:
|
||||||
|
query_status()
|
||||||
|
elif inp == 10:
|
||||||
query_info()
|
query_info()
|
||||||
else:
|
else:
|
||||||
print("Not a valid option.")
|
print("Not a valid option.")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue