Collects garbage

def __collectGarbage(self, ignored=None):
        """Collects garbage"""
        del ignored     # unused argument

        collected = []
        level0, level1, level2 = gc.get_count()

        if level0 > 0:
            collected.append(gc.collect(0))
            if level1 > 0:
                collected.append(gc.collect(1))
                if level2 > 0:
                    collected.append(gc.collect(2))

        if self.__where == GCPluginConfigDialog.SILENT:
            return

        message = ""
        if collected:
            for index in range(len(collected)):
                if collected[index] == 0:
                    continue
                if message:
                    message += ", "
                message += "generation " + str(index) + ": " + \
                           str(collected[index])
            if message:
                message = "GC objects: " + message
        else:
            message = "No GC objects"

        if not message:
            return

        if self.__where == GCPluginConfigDialog.STATUS_BAR:
            self.ide.showStatusBarMessage(message)
        else:
            logging.info(message)