summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/base/log.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/libcamera/base/log.cpp b/src/libcamera/base/log.cpp
index 42514de9..ea667189 100644
--- a/src/libcamera/base/log.cpp
+++ b/src/libcamera/base/log.cpp
@@ -861,19 +861,11 @@ const LogCategory &LogCategory::defaultCategory()
LogMessage::LogMessage(const char *fileName, unsigned int line,
const LogCategory &category, LogSeverity severity,
const std::string &prefix)
- : category_(category), severity_(severity), prefix_(prefix)
+ : category_(category), severity_(severity),
+ timestamp_(utils::clock::now()),
+ fileInfo_(static_cast<std::ostringstream &&>(std::ostringstream() << utils::basename(fileName) << ":" << line).str()),
+ prefix_(prefix)
{
- init(fileName, line);
-}
-
-void LogMessage::init(const char *fileName, unsigned int line)
-{
- /* Log the timestamp, severity and file information. */
- timestamp_ = utils::clock::now();
-
- std::ostringstream ossFileInfo;
- ossFileInfo << utils::basename(fileName) << ":" << line;
- fileInfo_ = ossFileInfo.str();
}
LogMessage::~LogMessage()