| Message ID | 20260119113104.3560802-5-barnabas.pocze@ideasonboard.com |
|---|---|
| State | New |
| Headers | show |
| Series |
|
| Related | show |
Quoting Barnabás Pőcze (2026-01-19 11:31:02) > A `LogMessage` instance cannot be moved or copied, so a severity of > `LogInvalid` is only possible if the message was constructed with that > log level explicitly. However, being a completely internal type, this > does not occur. So remove the check. And even if it does, it's probably > still better to print the message than to drop it silently. > > Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> > --- > src/libcamera/base/log.cpp | 4 ---- > 1 file changed, 4 deletions(-) > > diff --git a/src/libcamera/base/log.cpp b/src/libcamera/base/log.cpp > index da45b0d65..7d308afae 100644 > --- a/src/libcamera/base/log.cpp > +++ b/src/libcamera/base/log.cpp > @@ -857,10 +857,6 @@ LogMessage::LogMessage(const char *fileName, unsigned int line, > > LogMessage::~LogMessage() > { > - /* Don't print anything if we have been moved to another LogMessage. */ > - if (severity_ == LogInvalid) > - return; > - > Logger *logger = Logger::instance(); > if (!logger) > return; > -- > 2.52.0 >
diff --git a/src/libcamera/base/log.cpp b/src/libcamera/base/log.cpp index da45b0d65..7d308afae 100644 --- a/src/libcamera/base/log.cpp +++ b/src/libcamera/base/log.cpp @@ -857,10 +857,6 @@ LogMessage::LogMessage(const char *fileName, unsigned int line, LogMessage::~LogMessage() { - /* Don't print anything if we have been moved to another LogMessage. */ - if (severity_ == LogInvalid) - return; - Logger *logger = Logger::instance(); if (!logger) return;
A `LogMessage` instance cannot be moved or copied, so a severity of `LogInvalid` is only possible if the message was constructed with that log level explicitly. However, being a completely internal type, this does not occur. So remove the check. And even if it does, it's probably still better to print the message than to drop it silently. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> --- src/libcamera/base/log.cpp | 4 ---- 1 file changed, 4 deletions(-)