[FFmpeg-devel] [PATCH] configure: colorize error messages

Timothy Gu timothygu99 at gmail.com
Thu Sep 10 02:27:12 CEST 2015


On Wed, Sep 9, 2015 at 11:15 AM Ganesh Ajjanagadde <gajjanagadde at gmail.com>
wrote:

> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
> ---
>  configure | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/configure b/configure
> index 056feea..4842b52 100755
> --- a/configure
> +++ b/configure
> @@ -421,6 +421,7 @@ if test -t 1 && which tput >/dev/null; then
>      if test -n "$ncolors" && test $ncolors -ge 8; then
>          bold_color=$(tput bold)
>          warn_color=$(tput setaf 3)
> +        error_color=$(tput setaf 1)
>          reset_color=$(tput sgr0)
>      fi
>  fi
> @@ -437,7 +438,7 @@ log_file(){
>
>  echolog(){
>      log "$@"
> -    echo "$@"
> +    echo "$error_color$bold_color$@$reset_color"
>  }
>

You can inline this function in die() which is the only place this is used.
The function name `echolog` doesn't do anything to indicate that what's
echoed is an error.

Timothy


More information about the ffmpeg-devel mailing list