diff --git a/src/libcamera/log.cpp b/src/libcamera/log.cpp
index 26ebf410a7a9..7d930cd6b99e 100644
--- a/src/libcamera/log.cpp
+++ b/src/libcamera/log.cpp
@@ -358,6 +358,12 @@ static const char *log_severity_name(LogSeverity severity)
 		return "UNKWN";
 }
 
+static const char *basename(const char *path)
+{
+	const char *base = strrchr(path, '/');
+	return base ? ++base : path;
+}
+
 /**
  * \class LogMessage
  * \brief Internal log message representation.
