### Godot version

v4.1.beta.custom_build [ea6a141ff]

### System information

Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 (NVIDIA; 30.0.15.1403) - Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 Threads)

### Issue description

I noticed editor log misbehaving when a text is being printed. It seems to be mostly noticeable (or exclusive to?) when collapsing of duplicate messages is enabled.

https://github.com/godotengine/godot/assets/2223172/4ccfaa70-8991-4f5d-95ec-c732600b82ec

It looks like the log rebuilds from scratch with every message. If it had already some content, the text might be printed faster than it appears, causing it to be unreadable:

https://github.com/godotengine/godot/assets/2223172/6b69d308-37f1-4d8f-b47c-09f2e42eda43


### Steps to reproduce

```GDScript
func _process(delta: float) -> void:
	print("spam")
```

### Minimal reproduction project

N/A
ItemMeta *meta_hovering = nullptr;
	Variant current_meta;
	Array custom_effects;
	void _invalidate_current_line(ItemFrame *p_frame);
	void _thread_function(void *p_userdata);
	void _thread_end();
	void _stop_thread();
	bool _validate_line_caches();
	void _process_line_caches();
	void _add_item(Item *p_item, bool p_enter = false, bool p_ensure_newline = false);
	void _remove_item(Item *p_item, const int p_line, const int p_subitem_line);
	String language;
	TextDirection text_direction = TEXT_DIRECTION_AUTO;
	TextServer::StructuredTextParser st_parser = TextServer::STRUCTURED_TEXT_DEFAULT;
	Array st_args;
	struct Selection {
		ItemFrame *click_frame = nullptr;
		int click_line = 0;
		Item *click_item = nullptr;
		int click_char = 0;
		ItemFrame *from_frame = nullptr;
		int from_line = 0;
		Item *from_item = nullptr;
		int from_char = 0;
		ItemFrame *to_frame = nullptr;
		int to_line = 0;
		Item *to_item = nullptr;
		int to_char = 0;
		bool active = false; // 
		bool enabled = false; //