From e0ee10a52b42cbb65224c5926f91547851f10845 Mon Sep 17 00:00:00 2001 From: mquinson Date: Thu, 23 Jun 2005 15:20:02 +0000 Subject: [PATCH] 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 --- include/xbt/error.h | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) 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(); \ -- 2.20.1