From f75957ab6baef8907c8421f44f785956fbf48038 Mon Sep 17 00:00:00 2001 From: "Bala.FA" Date: Fri, 10 May 2013 12:30:17 +0530 Subject: log: error code generation support error code and message are generated at compile time by reading a json file which contains information of elements for each error code. This framework provides error handling and ability to do more cleaner log messages to users. error-codes.json file contains error description is below format { "ERR_NAME": {"code": ERR_NUM, "message": {"LOCALE": "ERR_MESSAGE"}} } At compile time autogen.sh calls gen-headers.py which produces C header file libglusterfs/src/gf-error-codes.h. This header has a function const char *_gf_get_message (int code); which returns respective ERR_MESSAGE for given ERR_NUM. Change-Id: Ieefbf4c470e19a0175c28942e56cec98a3c94ff0 BUG: 928648 Signed-off-by: Bala.FA Reviewed-on: http://review.gluster.org/4977 Reviewed-by: Niels de Vos Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- autogen.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'autogen.sh') diff --git a/autogen.sh b/autogen.sh index d3e513a0..f937e6be 100755 --- a/autogen.sh +++ b/autogen.sh @@ -75,6 +75,16 @@ if [ "x$MISSING" != "x" ]; then exit 1 fi +## generate gf-error-codes.h from error-codes.json +echo "Generate gf-error-codes.h ..." +if ./gen-headers.py; then + if ! mv -fv gf-error-codes.h libglusterfs/src/gf-error-codes.h; then + exit 1 + fi +else + exit 1 +fi + ## Do the autogeneration echo Running ${ACLOCAL}... $ACLOCAL -I ./contrib/aclocal -- cgit