You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

19 lines
484 B

import tail
from multiprocessing import Process
import sys
class LogProcess(Process):
def __init__(self, log_name, update_time):
super().__init__()
self.log_name = log_name
self.update_time = update_time
def func_log_print(self, txt):
sys.stdout.write(txt)
def run(self):
sys.stdout.write(self.log_name)
t = tail.Tail(self.log_name)
t.register_callback(self.func_log_print)
t.follow(s = self.update_time)