+LOGFILE = '/var/log/renew_reminder'
+class Logfile:
+ def __init__(self, filename):
+ self.filename = filename
+ def write(self, data):
+ try:
+ fd = os.open(self.filename, os.O_WRONLY | os.O_CREAT | os.O_APPEND, 0644)
+ os.write(fd, '%s' % data)
+ os.close(fd)
+ except OSError:
+ sys.stderr.write(data)
+ sys.stderr.flush()
+
+log = Logfile(LOGFILE)
+