remove exit() from lib. fix #634 (#696)

* remove exit() from lib. fix #634
* remove the UFATAL loglevel completely.
pull/697/head
Slyshyk Oleksiy 2018-03-28 11:03:38 +03:00 zatwierdzone przez Jerry Jacobs
rodzic 2ee6edc9ae
commit 7ec1fb78ba
2 zmienionych plików z 4 dodań i 13 usunięć

Wyświetl plik

@ -10,11 +10,10 @@ extern "C" {
#endif
enum ugly_loglevel {
UDEBUG = 90,
UINFO = 50,
UWARN = 30,
UERROR = 20,
UFATAL = 10
UDEBUG = 90,
UINFO = 50,
UWARN = 30,
UERROR = 20
};
int ugly_init(int maximum_threshold);
@ -33,8 +32,6 @@ int ugly_log(int level, const char *tag, const char *format, ...);
#define WLOG(...) WLOG_HELPER(__VA_ARGS__, "")
#define ELOG_HELPER(format, ...) ugly_log(UERROR, UGLY_LOG_FILE, format, __VA_ARGS__)
#define ELOG(...) ELOG_HELPER(__VA_ARGS__, "")
#define fatal_helper(format, ...) ugly_log(UFATAL, UGLY_LOG_FILE, format, __VA_ARGS__)
#define fatal(...) fatal_helper(__VA_ARGS__, "")
#ifdef __cplusplus
}

Wyświetl plik

@ -41,12 +41,6 @@ int ugly_log(int level, const char *tag, const char *format, ...) {
case UERROR:
fprintf(stderr, "ERROR %s: ", tag);
break;
case UFATAL:
fprintf(stderr, "FATAL %s: ", tag);
vfprintf(stderr, format, args);
exit(EXIT_FAILURE);
// NEVER GETS HERE!!!
break;
default:
fprintf(stderr, "%d %s: ", level, tag);
break;