[libcamera-devel,6/6] libcamera: log: Document the LogMessage class

Message ID 20181211191011.6315-7-laurent.pinchart@ideasonboard.com
State Accepted
Headers show
Series
  • Documentation: Initial Doxygen support
Related show

Commit Message

Laurent Pinchart Dec. 11, 2018, 7:10 p.m. UTC
Fix Doxygen build warnings by adding the missing documentation for the
LogMessage class.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/libcamera/log.cpp | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

Comments

Jacopo Mondi Dec. 12, 2018, 1:17 p.m. UTC | #1
Hi Laurent,
  a small thing I noticed while looking at the generated documentation

On Tue, Dec 11, 2018 at 09:10:11PM +0200, Laurent Pinchart wrote:
> Fix Doxygen build warnings by adding the missing documentation for the
> LogMessage class.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  src/libcamera/log.cpp | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
>
> diff --git a/src/libcamera/log.cpp b/src/libcamera/log.cpp
> index c5345cf079a3..953f8805cb97 100644
> --- a/src/libcamera/log.cpp
> +++ b/src/libcamera/log.cpp
> @@ -54,6 +54,20 @@ static const char *log_severity_name(LogSeverity severity)
>  		return "UNKN";
>  }
>
> +/**
> + * \class LogMessage
> + * \brief Internal log message representation.
> + *
> + * The LogMessage class models a single message in the log. It serves as a
> + * helper to provide the std::ostream API for logging, and much never be used

s/much/must ?

Thanks
   j

> + * directly. Use the LOG() macro instead access the log infrastructure.
> + */
> +
> +/**
> + * Create a log message pertaining to line \a line of file \a fileName. The
> + * \a severity argument sets the message severity to control whether it will be
> + * output or dropped.
> + */
>  LogMessage::LogMessage(const char *fileName, unsigned int line,
>  		       LogSeverity severity)
>  {
> @@ -78,4 +92,12 @@ LogMessage::~LogMessage()
>  	fflush(stderr);
>  }
>
> +/**
> + * \fn std::ostream& LogMessage::stream()
> + *
> + * Data is added to a LogMessage through the stream returned by this function.
> + * The stream implements the std::ostream API and can be used for logging as
> + * std::cout.
> + */
> +
>  } /* namespace libcamera */
> --
> Regards,
>
> Laurent Pinchart
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
Laurent Pinchart Dec. 12, 2018, 6:18 p.m. UTC | #2
Hi Jacopo,

On Wednesday, 12 December 2018 15:17:48 EET jacopo mondi wrote:
> Hi Laurent,
>   a small thing I noticed while looking at the generated documentation
> 
> On Tue, Dec 11, 2018 at 09:10:11PM +0200, Laurent Pinchart wrote:
> > Fix Doxygen build warnings by adding the missing documentation for the
> > LogMessage class.
> > 
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > ---
> > 
> >  src/libcamera/log.cpp | 22 ++++++++++++++++++++++
> >  1 file changed, 22 insertions(+)
> > 
> > diff --git a/src/libcamera/log.cpp b/src/libcamera/log.cpp
> > index c5345cf079a3..953f8805cb97 100644
> > --- a/src/libcamera/log.cpp
> > +++ b/src/libcamera/log.cpp
> > @@ -54,6 +54,20 @@ static const char *log_severity_name(LogSeverity
> > severity)> 
> >  		return "UNKN";
> >  
> >  }
> > 
> > +/**
> > + * \class LogMessage
> > + * \brief Internal log message representation.
> > + *
> > + * The LogMessage class models a single message in the log. It serves as
> > a
> > + * helper to provide the std::ostream API for logging, and much never be
> > used
> 
> s/much/must ?

Of course. I'll fix that.

> > + * directly. Use the LOG() macro instead access the log infrastructure.
> > + */
> > +

[snip]

Patch

diff --git a/src/libcamera/log.cpp b/src/libcamera/log.cpp
index c5345cf079a3..953f8805cb97 100644
--- a/src/libcamera/log.cpp
+++ b/src/libcamera/log.cpp
@@ -54,6 +54,20 @@  static const char *log_severity_name(LogSeverity severity)
 		return "UNKN";
 }
 
+/**
+ * \class LogMessage
+ * \brief Internal log message representation.
+ *
+ * The LogMessage class models a single message in the log. It serves as a
+ * helper to provide the std::ostream API for logging, and much never be used
+ * directly. Use the LOG() macro instead access the log infrastructure.
+ */
+
+/**
+ * Create a log message pertaining to line \a line of file \a fileName. The
+ * \a severity argument sets the message severity to control whether it will be
+ * output or dropped.
+ */
 LogMessage::LogMessage(const char *fileName, unsigned int line,
 		       LogSeverity severity)
 {
@@ -78,4 +92,12 @@  LogMessage::~LogMessage()
 	fflush(stderr);
 }
 
+/**
+ * \fn std::ostream& LogMessage::stream()
+ *
+ * Data is added to a LogMessage through the stream returned by this function.
+ * The stream implements the std::ostream API and can be used for logging as
+ * std::cout.
+ */
+
 } /* namespace libcamera */