added "log less" to log management
This commit is contained in:
parent
7f86d66c13
commit
2d437f434a
1 changed files with 10 additions and 1 deletions
|
|
@ -262,11 +262,20 @@ Usage:
|
||||||
except IOError:
|
except IOError:
|
||||||
self.print_color(RED, "Logfile not found.")
|
self.print_color(RED, "Logfile not found.")
|
||||||
self.help_log()
|
self.help_log()
|
||||||
|
elif text == "less":
|
||||||
|
try:
|
||||||
|
# TODO: do the tail on the logfile set by args and not a static path
|
||||||
|
with open(os.path.dirname(os.path.abspath(__file__)) + "/../../log/linspector.log"):
|
||||||
|
os.system("less " + os.path.dirname(os.path.abspath(__file__)) + "/../../log/linspector.log")
|
||||||
|
except IOError:
|
||||||
|
self.print_color(RED, "Logfile not found.")
|
||||||
|
self.help_log()
|
||||||
|
|
||||||
def help_log(self):
|
def help_log(self):
|
||||||
print('''
|
print('''
|
||||||
Usage:
|
Usage:
|
||||||
tail Do a "tail -F" on the linspector logfile (Ctrl+C to exit)
|
less less on the linspector logfile (press "q" to exit)
|
||||||
|
tail tail on the linspector logfile (Ctrl+C to exit)
|
||||||
''')
|
''')
|
||||||
|
|
||||||
def do_status(self, text):
|
def do_status(self, text):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue