def execute()

in operators.py [0:0]


    def execute(self, context):
        log_text = bpy.data.texts.get("meshgen log")
        if log_text is None:
            log_text = bpy.data.texts.new("meshgen log")
        for area in context.screen.areas:
            if area.type == "TEXT_EDITOR":
                area.spaces.active.text = log_text
                return {"FINISHED"}
        bpy.ops.screen.area_split(direction="VERTICAL")
        new_area = context.screen.areas[-1]
        new_area.type = "TEXT_EDITOR"
        new_area.spaces.active.text = log_text
        return {"FINISHED"}