def watch(self, raw_args):
def tail(_file):
_file.seek(0, 2) # Go to the end of the file
while True:
line = _file.readline()
if not line:
time.sleep(0.1)
continue
yield line
_file = open(_log_path, 'r')
print (Fore.GREEN + '[bitmask] ' +
Fore.RESET + 'Watching log file %s' % _log_path)
for line in _file.readlines():
print line,
for line in tail(_file):
print line,
评论列表
文章目录