From 3d1be3b3cbf934ef29928d6bd92bbf002b08a982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Wed, 25 Nov 2020 23:24:27 +0100 Subject: [PATCH] Improve debug trace logging. --- source/vibe/core/core.d | 1 + source/vibe/core/task.d | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/source/vibe/core/core.d b/source/vibe/core/core.d index 6a5dfec..37a38fb 100644 --- a/source/vibe/core/core.d +++ b/source/vibe/core/core.d @@ -428,6 +428,7 @@ package Task runTask_internal(alias TFI_SETUP)() () @trusted { TaskFiber.ms_taskEventCallback(TaskEvent.preStart, handle); } (); } + debug (VibeTaskLog) logTrace("Switching to newly created task"); switchToTask(handle); debug if (TaskFiber.ms_taskEventCallback) { diff --git a/source/vibe/core/task.d b/source/vibe/core/task.d index 3d53201..28854d0 100644 --- a/source/vibe/core/task.d +++ b/source/vibe/core/task.d @@ -823,6 +823,7 @@ package struct TaskScheduler { bool any_events = false; while (true) { + debug (VibeTaskLog) logTrace("Scheduling before peeking new events..."); // process pending tasks bool any_tasks_processed = schedule() != ScheduleStatus.idle; @@ -952,7 +953,7 @@ package struct TaskScheduler { auto thistf = () @trusted { return thist.taskFiber; } (); assert(!thistf || !thistf.m_queue, "Calling task is running, but scheduled to be resumed!?"); - debug (VibeTaskLog) logDebugV("Switching tasks (%s already in queue)", m_taskQueue.length); + debug (VibeTaskLog) logDebugV("Switching tasks (%s already in queue, prio=%s)", m_taskQueue.length, priority); final switch (priority) { case TaskSwitchPriority.normal: reschedule(tf);