def __call__(self, msg):
        """Log the message."""
        if self._fd and not self._fd.closed:
            ct = time.time()
            msecs = (ct - long(ct)) * 1000
            pathname, lineno, name = find_caller()
            try:
                mod = os.path.splitext(".".join(map(os.path.basename, os.path.split(pathname))))[:-1][0]
            except (TypeError, ValueError, AttributeError):
                mod = "Unknown module"
            ts = time.strftime("%Y-%m-%d %H:%M:%S", (time.localtime(ct)))
            self._fd.write("%s,%03d %s:%s(%s): %s\n" % (ts, msecs, mod, name, lineno, msg))
            self._fd.flush()
def __call__ ( self , msg ) : if self . _fd and not self . _fd . closed : ct = time . time ( ) msecs = ( ct - long ( ct ) ) * 1000 pathname , lineno , name = find_caller ( ) try : mod = os . path . splitext ( "." . join ( map ( os . path . basename , os . path . split ( pathname ) ) ) ) [ : - 1 ] [ 0 ] except ( TypeError , ValueError , AttributeError ) : mod = "Unknown module" ts = time . strftime ( "%Y-%m-%d %H:%M:%S" , ( time . localtime ( ct ) ) ) self . _fd . write ( "%s,%03d %s:%s(%s): %s\n" % ( ts , msecs , mod , name , lineno , msg ) ) self . _fd . flush ( )
Log the message.