<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def warn(self,message):
 """write a warning to the log file. Parameters message : str the warning text """

        s = str(datetime.now()) + " WARNING: " + message + '\n'
        if self.echo:
            print(s,end='')
        if self.filename:
            self.f.write(s)
            self.f.flush
        warnings.warn(s,PyemuWarning)