libcamera: log: Add a LogFatal log level

The LogFatal log level is similar to the LogError level, but
additionally abort program execution. This is useful to implement
assertion handlers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Laurent Pinchart
2019-01-08 16:23:16 +02:00
parent e256a58bf0
commit 99a3e7bcfb
2 changed files with 17 additions and 4 deletions
+2
View File
@@ -16,6 +16,7 @@ enum LogSeverity {
LogInfo,
LogWarning,
LogError,
LogFatal,
};
class LogMessage
@@ -30,6 +31,7 @@ public:
private:
std::ostringstream msgStream;
LogSeverity severity_;
};
#define LOG(severity) LogMessage(__FILE__, __LINE__, Log##severity).stream()