diff --git a/include/libcamera/base/log.h b/include/libcamera/base/log.h
index dbd14951c..8419300a5 100644
--- a/include/libcamera/base/log.h
+++ b/include/libcamera/base/log.h
@@ -130,9 +130,11 @@ LogMessage _log(const LogCategory &category, LogSeverity severity,
 
 #ifndef NDEBUG
 #define ASSERT(condition) static_cast<void>(({                          \
-	if (!(condition))                                               \
-		LOG(Fatal) << "assertion \"" #condition "\" failed in " \
-			   << __func__ << "()";                         \
+	if (!(condition)) {                                             \
+		_log(LogCategory::defaultCategory(), LogFatal).stream() \
+			<< "assertion \"" #condition "\" failed in "    \
+			<< __func__ << "()";                            \
+	}                                                               \
 }))
 #else
 #define ASSERT(condition) static_cast<void>(false && (condition))
