Skip to content

Commit 8e64530

Browse files
committedMar 13, 2016
add current date to output
1 parent da04a68 commit 8e64530

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed
 

‎logps.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import re
55
import time
66
import subprocess
7+
from datetime import datetime
78

89

910
def process_list():
@@ -26,7 +27,13 @@ def log(self, row):
2627
pid = find_pid(row)
2728
if pid not in self.know_pids:
2829
self.know_pids.append(pid)
29-
print row.strip()
30+
print self._format_row(row)
31+
32+
def _format_row(self, row):
33+
return "%s %s" % (self._now(), row.strip())
34+
35+
def _now(self):
36+
return datetime.now().isoformat()
3037

3138

3239
def main():

0 commit comments

Comments
 (0)
Please sign in to comment.