diff options
author | grothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96> | 2012-06-23 22:24:50 +0000 |
---|---|---|
committer | grothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96> | 2012-06-23 22:24:50 +0000 |
commit | fc568cce82d65e8196230e678853657c800da6b9 (patch) | |
tree | 7e421bfae7f6efc16834816d30c81356d3c5b041 /src/util/common_logging.c | |
parent | a7e40c3b0df908d8f84acafb0290fed3b218f995 (diff) |
-LRN: Change logskipping to use functions only:
Remember these weird "skip_log" functions in my gdb backtraces?
I hope that this patch will get rid of them.
Shouldn't affect existing uses of the API.
git-svn-id: https://gnunet.org/svn/gnunet@22238 140774ce-b5e7-0310-ab8b-a85725594a96
Diffstat (limited to 'src/util/common_logging.c')
-rw-r--r-- | src/util/common_logging.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/util/common_logging.c b/src/util/common_logging.c index ff11c77773..20f852c356 100644 --- a/src/util/common_logging.c +++ b/src/util/common_logging.c @@ -152,7 +152,7 @@ static struct CustomLogger *loggers; /** * Number of log calls to ignore. */ -unsigned int skip_log; +int skip_log = 0; /** * File descriptor to use for "stderr", or NULL for none. @@ -810,11 +810,11 @@ flush_bulk (const char *datestr) /** * Ignore the next n calls to the log function. * - * @param n number of log calls to ignore + * @param n number of log calls to ignore (could be negative) * @param check_reset GNUNET_YES to assert that the log skip counter is currently zero */ void -GNUNET_log_skip (unsigned int n, int check_reset) +GNUNET_log_skip (int n, int check_reset) { int ok; @@ -831,6 +831,16 @@ GNUNET_log_skip (unsigned int n, int check_reset) } } +/** + * Get the number of log calls that are going to be skipped + * + * @return number of log calls to be ignored + */ +int +GNUNET_get_log_skip () +{ + return skip_log; +} /** * Output a log message using the default mechanism. |