def set_logfile(self, filename, max_bytes=0, backup_count=0):
        """
        Setup logging to a (rotating) logfile.

        Args:
            filename (str): Logfile. If filename is None, disable file logging
            max_bytes (int): Maximum number of bytes per logfile. If used together with backup_count,
                             logfile will be rotated when it reaches this amount of bytes.
            backup_count (int): Number of rotated logfiles to keep
        """
        _logger = logging.getLogger("neo-python")

        if not filename and not self.rotating_filehandler:
            _logger.removeHandler(self.rotating_filehandler)
        else:
            self.rotating_filehandler = RotatingFileHandler(filename, mode='a', maxBytes=max_bytes, backupCount=backup_count, encoding=None)
            self.rotating_filehandler.setLevel(logging.DEBUG)
            self.rotating_filehandler.setFormatter(LogFormatter(color=False))
            _logger.addHandler(self.rotating_filehandler)
def set_logfile ( self , filename , max_bytes = 0 , backup_count = 0 ) : _logger = logging . getLogger ( "neo-python" ) if not filename and not self . rotating_filehandler : _logger . removeHandler ( self . rotating_filehandler ) else : self . rotating_filehandler = RotatingFileHandler ( filename , mode = 'a' , maxBytes = max_bytes , backupCount = backup_count , encoding = None ) self . rotating_filehandler . setLevel ( logging . DEBUG ) self . rotating_filehandler . setFormatter ( LogFormatter ( color = False ) ) _logger . addHandler ( self . rotating_filehandler )
Setup logging to a (rotating) logfile.

        Args:
            filename (str): Logfile. If filename is None, disable file logging
            max_bytes (int): Maximum number of bytes per logfile. If used together with backup_count,
                             logfile will be rotated when it reaches this amount of bytes.
            backup_count (int): Number of rotated logfiles to keep