From: mquinson Date: Thu, 23 Jun 2005 15:20:02 +0000 (+0000) Subject: don't use printf bug logs. Even when raising an error X-Git-Tag: v3.3~3958 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/e0ee10a52b42cbb65224c5926f91547851f10845?hp=7376dfcfee00f204338e7e05a2a2da5b5b5d7e36 don't use printf bug logs. Even when raising an error git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1397 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/include/xbt/error.h b/include/xbt/error.h index c42728c01b..b8ea1f0a6c 100644 --- a/include/xbt/error.h +++ b/include/xbt/error.h @@ -65,12 +65,10 @@ typedef enum { /** @brief return the error code if != no_error * @hideinitializer */ -#define TRY(action) do { \ - if ((errcode=action) != no_error) { \ - fprintf (stderr, "%s:%d: '%s' error raising...\n", \ - __FILE__,__LINE__, \ - xbt_error_name(errcode)); \ - return errcode; \ +#define TRY(action) do { \ + if ((errcode=action) != no_error) { \ + ERROR1("'%s' error raising...", xbt_error_name(errcode)); \ + return errcode; \ } } while (0) /** @brief return the error code if != no_error and != \a catched @@ -83,9 +81,7 @@ typedef enum { */ #define TRYFAIL(action) do { \ if ((errcode=action) != no_error) { \ - fprintf(stderr,"%s:%d: Got '%s' error !\n", \ - __FILE__,__LINE__, \ - xbt_error_name(errcode)); \ + ERROR1("Got '%s' error !", xbt_error_name(errcode)); \ fflush(stdout); \ xbt_abort(); \ } } while(0) @@ -97,7 +93,7 @@ typedef enum { #define TRYEXPECT(action,expected_error) do { \ errcode=action; \ if (errcode != expected_error) { \ - fprintf(stderr,"Got error %s (instead of %s expected)\n", \ + ERROR2("Got error %s (instead of %s expected)\n", \ xbt_error_name(errcode), \ xbt_error_name(expected_error)); \ xbt_abort(); \