code: def log(self, msg):
          '''Log a message, prefixed with a timestamp.
  
          If a log file was specified in the constructor, it is written there,
          otherwise it goes to stdout.
          '''
          if self.logfile:
              fd = self.logfile.fileno()
          else:
              fd = sys.stdout.fileno()
  
          os.write(fd, ('%.3f %s\n' % (time.time(), msg)).encode('UTF-8')f log(self, msg):
          '''Log a message, prefixed with a timestamp.
  
          If a log file was specified in the constructor, it is written there,
          otherwise it goes to stdout.
          '''
          if self.logfile:
              fd = self.logfile.fileno()
          else:
              fd = sys.stdout.fileno()
  
          os.write(fd, ('%.3f %s\n' % (time.time(), msg)).encode('UTF-8'))
docs: Log a message, prefixed with a timestamp.
  
          If a log file was specified in the constructor, it is written there,
          otherwise it goes to stdout.