From b9f7e269b6be514ac520d061d8c9f6a0b1bbaded Mon Sep 17 00:00:00 2001 From: Paul Elder Date: Sat, 13 Jul 2019 00:09:51 +0900 Subject: libcamera: logging: add syslog, stream, and nowhere logging targets Allow logging to syslog, or any given ostream, or to nowhere. The logging API is updated to accomodate these new logging destinations. LogMessage is modified to allow this. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart --- src/libcamera/include/log.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/libcamera/include') diff --git a/src/libcamera/include/log.h b/src/libcamera/include/log.h index 802836d2..9b203f97 100644 --- a/src/libcamera/include/log.h +++ b/src/libcamera/include/log.h @@ -60,12 +60,20 @@ public: std::ostream &stream() { return msgStream_; } + const struct timespec ×tamp() const { return timestamp_; } + LogSeverity severity() const { return severity_; } + const LogCategory &category() const { return category_; } + const std::string &fileInfo() const { return fileInfo_; } + const std::string msg() const { return msgStream_.str(); } + private: void init(const char *fileName, unsigned int line); std::ostringstream msgStream_; const LogCategory &category_; LogSeverity severity_; + struct timespec timestamp_; + std::string fileInfo_; }; class Loggable -- cgit v1.2.1