Skip to content

Commit 724e2b1

Browse files
committed
chore: add diagnostic logs for session restore debugging
- Log each buffer's load result (id, path, exists) in BufferManager::LoadBuffers - Log workspace buffer filter results in WorkspaceManager::LoadWorkspaces Co-Authored-By: Le Tan <tamlokveer@gmail.com>
1 parent c69645a commit 724e2b1

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/core/buffer_manager.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ void BufferManager::LoadBuffers() {
3636
}
3737

3838
for (const auto &record : session_config.buffers) {
39+
VXCORE_LOG_INFO("LoadBuffers: processing record id=%s, notebook_id=%s, file_path=%s",
40+
record.id.c_str(), record.notebook_id.c_str(), record.file_path.c_str());
41+
3942
// Resolve notebook pointer if notebook_id is not empty
4043
Notebook *notebook = nullptr;
4144
if (!record.notebook_id.empty()) {
@@ -55,7 +58,11 @@ void BufferManager::LoadBuffers() {
5558
full_path = record.file_path;
5659
}
5760

58-
if (!std::filesystem::exists(full_path)) {
61+
bool exists = std::filesystem::exists(full_path);
62+
VXCORE_LOG_INFO("LoadBuffers: id=%s, full_path=%s, exists=%d",
63+
record.id.c_str(), full_path.c_str(), exists ? 1 : 0);
64+
65+
if (!exists) {
5966
VXCORE_LOG_WARN("Skipping buffer: file not found on disk: %s", full_path.c_str());
6067
continue;
6168
}

src/core/workspace_manager.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ void WorkspaceManager::LoadWorkspaces() {
4242
// Filter buffer_ids to only include IDs that exist in BufferManager
4343
if (buffer_manager_) {
4444
for (const auto &buf_id : record.buffer_ids) {
45-
if (buffer_manager_->GetBuffer(buf_id) != nullptr) {
45+
bool found = (buffer_manager_->GetBuffer(buf_id) != nullptr);
46+
VXCORE_LOG_INFO("LoadWorkspaces: ws='%s' checking buffer '%s': found=%d",
47+
record.name.c_str(), buf_id.c_str(), found ? 1 : 0);
48+
if (found) {
4649
workspace->buffer_ids.push_back(buf_id);
4750
} else {
4851
VXCORE_LOG_WARN("Workspace '%s': skipping missing buffer: %s", record.name.c_str(),

0 commit comments

Comments
 (0)