def make_alert(warnfile, msg_type, msg_template, timestamp_format=None):
 def t_format():
  return int(time.time())
 if (timestamp_format is None):
  timestamp_format = t_format
 def alert(*params):
  formatted_msg = ((msg_type + ' DCTB ') + (msg_template % params))
  timestamped_msg = prepend_timestamp(formatted_msg, timestamp_format)
  print >>warnfile, timestamped_msg
 return alert

def make_alert ( warnfile , msg_type , msg_template , timestamp_format = None ) : def t_format ( ) : return int ( time . time ( ) ) if ( timestamp_format is None ) : timestamp_format = t_format def alert ( * params ) : formatted_msg = ( ( msg_type + ' DCTB ' ) + ( msg_template % params ) ) timestamped_msg = prepend_timestamp ( formatted_msg , timestamp_format ) print >> warnfile , timestamped_msg return alert
create an alert generation function that writes to warnfile .