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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user