[FFmpeg-devel] [PATCH 3/3] log: color prefixes according to their source.

Michael Niedermayer michaelni at gmx.at
Sun Jun 3 22:17:51 CEST 2012


On Fri, Jun 01, 2012 at 08:02:32AM +0200, Clément Bœsch wrote:
> On Mon, May 28, 2012 at 12:53:29PM +0200, Michael Niedermayer wrote:
> > The use of cyan is droped from the levels to avoid confusion
> > magenta/cyan/blue is used for muxer/codec/filter layer
> > 
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > ---
> >  libavutil/log.c |   58 +++++++++++++++++++++++++++++++++++++++++++------------
> >  1 file changed, 46 insertions(+), 12 deletions(-)
> > 
> > diff --git a/libavutil/log.c b/libavutil/log.c
> > index e62f11c..22f2364 100644
> > --- a/libavutil/log.c
> > +++ b/libavutil/log.c
> > @@ -34,13 +34,17 @@ static int flags;
> >  
> >  #if defined(_WIN32) && !defined(__MINGW32CE__)
> >  #include <windows.h>
> > -static const uint8_t color[] = { 12, 12, 12, 14, 7, 10, 11 };
> > +static const uint8_t color[] = { 12, 12, 12, 14, 7, 10, 10,
> > +                                  3, 11,  5, 13, 1,  9
> > +};
> >  static int16_t background, attr_orig;
> >  static HANDLE con;
> >  #define set_color(x)  SetConsoleTextAttribute(con, background | color[x])
> >  #define reset_color() SetConsoleTextAttribute(con, attr_orig)
> >  #else
> > -static const uint8_t color[] = { 0x41, 0x41, 0x11, 0x03, 9, 0x02, 0x06 };
> > +static const uint8_t color[] = { 0x41, 0x41, 0x11, 0x03, 9, 0x02, 0x02,
> > +                                 0x06, 0x16, 0x05, 0x15, 0x04, 0x14
> > +};
> 
> 
> This is going more and more crazy… I think we should explicit a little
> this, like:
> 
>     static const uint8_t color[AV_LOG_NB_COLOR] = {
>         [AV_LOG_COLOR...] = AV_LOG_COLOR_...,
>         ...
>     }

improved and applied

thanks

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 3
"Rare item" - "Common item with rare defect or maybe just a lie"
"Professional" - "'Toy' made in china, not functional except as doorstop"
"Experts will know" - "The seller hopes you are not an expert"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120603/b8ae482e/attachment.asc>


More information about the ffmpeg-devel mailing list