Created
May 31, 2018 01:52
-
-
Save v0112358/f44c24df0c1fc36e409551a8151cbd01 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
from pygtail import Pygtail | |
from pathlib2 import Path | |
try: | |
sys.argv[1] | |
except: | |
print "Usage: pygtail.py <path-to-log-file>" | |
else: | |
log_file = Path(str(sys.argv[1])) | |
if log_file.is_file(): | |
for line in Pygtail(str(log_file)): | |
sys.stdout.write(line) | |
else: | |
print(log_file + " dose not exist !") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment