diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-06-23 22:24:50 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-06-23 22:24:50 +0000 |
commit | d30c25b427875a16cc46cfd091f595f119e570bc (patch) | |
tree | 7e421bfae7f6efc16834816d30c81356d3c5b041 /src/util/common_logging.c | |
parent | 8e6c69b6322f9d3f3f2a32040431a3b056302132 (diff) | |
download | gnunet-d30c25b427875a16cc46cfd091f595f119e570bc.tar.gz gnunet-d30c25b427875a16cc46cfd091f595f119e570bc.zip |
-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.
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 ff11c7777..20f852c35 100644 --- a/src/util/common_logging.c +++ b/src/util/common_logging.c | |||
@@ -152,7 +152,7 @@ static struct CustomLogger *loggers; | |||
152 | /** | 152 | /** |
153 | * Number of log calls to ignore. | 153 | * Number of log calls to ignore. |
154 | */ | 154 | */ |
155 | unsigned int skip_log; | 155 | int skip_log = 0; |
156 | 156 | ||
157 | /** | 157 | /** |
158 | * File descriptor to use for "stderr", or NULL for none. | 158 | * File descriptor to use for "stderr", or NULL for none. |
@@ -810,11 +810,11 @@ flush_bulk (const char *datestr) | |||
810 | /** | 810 | /** |
811 | * Ignore the next n calls to the log function. | 811 | * Ignore the next n calls to the log function. |
812 | * | 812 | * |
813 | * @param n number of log calls to ignore | 813 | * @param n number of log calls to ignore (could be negative) |
814 | * @param check_reset GNUNET_YES to assert that the log skip counter is currently zero | 814 | * @param check_reset GNUNET_YES to assert that the log skip counter is currently zero |
815 | */ | 815 | */ |
816 | void | 816 | void |
817 | GNUNET_log_skip (unsigned int n, int check_reset) | 817 | GNUNET_log_skip (int n, int check_reset) |
818 | { | 818 | { |
819 | int ok; | 819 | int ok; |
820 | 820 | ||
@@ -831,6 +831,16 @@ GNUNET_log_skip (unsigned int n, int check_reset) | |||
831 | } | 831 | } |
832 | } | 832 | } |
833 | 833 | ||
834 | /** | ||
835 | * Get the number of log calls that are going to be skipped | ||
836 | * | ||
837 | * @return number of log calls to be ignored | ||
838 | */ | ||
839 | int | ||
840 | GNUNET_get_log_skip () | ||
841 | { | ||
842 | return skip_log; | ||
843 | } | ||
834 | 844 | ||
835 | /** | 845 | /** |
836 | * Output a log message using the default mechanism. | 846 | * Output a log message using the default mechanism. |