[libcamera-devel,10/17] libcamera: stream: Define log object

Message ID 20190527001543.13593-11-niklas.soderlund@ragnatech.se
State Superseded
Headers show
Series
  • libcamera: Add support for format information and validation
Related show

Commit Message

Niklas Söderlund May 27, 2019, 12:15 a.m. UTC
Define a LOG object to prepare for adding code which needs to write to
the log.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
---
 src/libcamera/stream.cpp | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Kieran Bingham May 29, 2019, 9:47 p.m. UTC | #1
Hi Niklas,

On 27/05/2019 01:15, Niklas Söderlund wrote:
> Define a LOG object to prepare for adding code which needs to write to
> the log.
> 

I think this could have been squashed into the first usage that adds a
LOG(), but I'm sure it's fine here if you really want it split.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
> ---
>  src/libcamera/stream.cpp | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp
> index 0c59a31a3a0501d3..eecd37160150d55c 100644
> --- a/src/libcamera/stream.cpp
> +++ b/src/libcamera/stream.cpp
> @@ -10,6 +10,8 @@
>  #include <iomanip>
>  #include <sstream>
>  
> +#include "log.h"
> +
>  /**
>   * \file stream.h
>   * \brief Video stream for a Camera
> @@ -32,6 +34,8 @@
>  
>  namespace libcamera {
>  
> +LOG_DEFINE_CATEGORY(Stream)
> +
>  /**
>   * \struct StreamConfiguration
>   * \brief Configuration parameters for a stream
>
Laurent Pinchart June 8, 2019, 4:37 p.m. UTC | #2
On Wed, May 29, 2019 at 10:47:15PM +0100, Kieran Bingham wrote:
> Hi Niklas,
> 
> On 27/05/2019 01:15, Niklas Söderlund wrote:
> > Define a LOG object to prepare for adding code which needs to write to
> > the log.
> > 
> 
> I think this could have been squashed into the first usage that adds a
> LOG(), but I'm sure it's fine here if you really want it split.
> 
> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

Exactly my opinion :-) Such a small patch would be easier to review if
it was squashed, as otherwise I need to check the rest of the series to
see where it actually gets used.

> > Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
> > ---
> >  src/libcamera/stream.cpp | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp
> > index 0c59a31a3a0501d3..eecd37160150d55c 100644
> > --- a/src/libcamera/stream.cpp
> > +++ b/src/libcamera/stream.cpp
> > @@ -10,6 +10,8 @@
> >  #include <iomanip>
> >  #include <sstream>
> >  
> > +#include "log.h"
> > +
> >  /**
> >   * \file stream.h
> >   * \brief Video stream for a Camera
> > @@ -32,6 +34,8 @@
> >  
> >  namespace libcamera {
> >  
> > +LOG_DEFINE_CATEGORY(Stream)
> > +
> >  /**
> >   * \struct StreamConfiguration
> >   * \brief Configuration parameters for a stream

Patch

diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp
index 0c59a31a3a0501d3..eecd37160150d55c 100644
--- a/src/libcamera/stream.cpp
+++ b/src/libcamera/stream.cpp
@@ -10,6 +10,8 @@ 
 #include <iomanip>
 #include <sstream>
 
+#include "log.h"
+
 /**
  * \file stream.h
  * \brief Video stream for a Camera
@@ -32,6 +34,8 @@ 
 
 namespace libcamera {
 
+LOG_DEFINE_CATEGORY(Stream)
+
 /**
  * \struct StreamConfiguration
  * \brief Configuration parameters for a stream