def METHOD_NAME(self):
    file, ok = QFileDialog.getSaveFileName(
        self, "Save output", "", "Log Files (*.log);;All Files (*)"
    )
    if ok:
        if "." not in file:
            file += ".log"
        with open(file, "w") as f:
            f.write(self.console.toPlainText())
            f.close()
            self.save_button.setText(self.tr("Saved"))