diff options
author | grothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96> | 2011-10-10 14:00:34 +0000 |
---|---|---|
committer | grothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96> | 2011-10-10 14:00:34 +0000 |
commit | 283a59b0335c0f302b9739b53e3472c2b5413588 (patch) | |
tree | e33f1b7abaea4d85637aa3a6bd8f2e4230e03f25 /src/datacache | |
parent | 1db37ffa07421b5bb2c6a957ba6f5c59ef6ca770 (diff) |
use LOG macro in datacache.c
git-svn-id: https://gnunet.org/svn/gnunet@17356 140774ce-b5e7-0310-ab8b-a85725594a96
Diffstat (limited to 'src/datacache')
-rw-r--r-- | src/datacache/datacache.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/datacache/datacache.c b/src/datacache/datacache.c index 43a9234e59..51d5d34235 100644 --- a/src/datacache/datacache.c +++ b/src/datacache/datacache.c @@ -29,6 +29,8 @@ #include "gnunet_statistics_service.h" #include "gnunet_datacache_plugin.h" +#define LOG(kind,...) GNUNET_log_from (kind, "datacache", __VA_ARGS__) + /** * Internal state of the datacache library. */ @@ -130,17 +132,16 @@ GNUNET_DATACACHE_create (const struct GNUNET_CONFIGURATION_Handle *cfg, if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_number (cfg, section, "QUOTA", "a)) { - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - _("No `%s' specified for `%s' in configuration!\n"), "QUOTA", - section); + LOG (GNUNET_ERROR_TYPE_ERROR, + _("No `%s' specified for `%s' in configuration!\n"), "QUOTA", section); return NULL; } if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (cfg, section, "DATABASE", &name)) { - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - _("No `%s' specified for `%s' in configuration!\n"), "DATABASE", - section); + LOG (GNUNET_ERROR_TYPE_ERROR, + _("No `%s' specified for `%s' in configuration!\n"), "DATABASE", + section); return NULL; } bf_size = quota / 32; /* 8 bit per entry, 1 bit per 32 kb in DB */ @@ -164,16 +165,15 @@ GNUNET_DATACACHE_create (const struct GNUNET_CONFIGURATION_Handle *cfg, ret->env.cls = ret; ret->env.delete_notify = &env_delete_notify; ret->env.quota = quota; - GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Loading `%s' datacache plugin\n"), - name); + LOG (GNUNET_ERROR_TYPE_INFO, _("Loading `%s' datacache plugin\n"), name); GNUNET_asprintf (&libname, "libgnunet_plugin_datacache_%s", name); ret->short_name = name; ret->lib_name = libname; ret->api = GNUNET_PLUGIN_load (libname, &ret->env); if (ret->api == NULL) { - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - _("Failed to load datacache plugin for `%s'\n"), name); + LOG (GNUNET_ERROR_TYPE_ERROR, + _("Failed to load datacache plugin for `%s'\n"), name); GNUNET_DATACACHE_destroy (ret); return NULL; } @@ -199,8 +199,8 @@ GNUNET_DATACACHE_destroy (struct GNUNET_DATACACHE_Handle *h) if (h->bloom_name != NULL) { if (0 != UNLINK (h->bloom_name)) - GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "unlink", - h->bloom_name); + GNUNET_log_from_strerror_file (GNUNET_ERROR_TYPE_WARNING, "datacache", + "unlink", h->bloom_name); GNUNET_free (h->bloom_name); } GNUNET_STATISTICS_destroy (h->stats, GNUNET_NO); @@ -237,7 +237,7 @@ GNUNET_DATACACHE_put (struct GNUNET_DATACACHE_Handle *h, GNUNET_NO); GNUNET_CONTAINER_bloomfilter_add (h->filter, key); while (h->utilization + used > h->env.quota) - GNUNET_assert (GNUNET_OK == h->api->del (h->api->cls)); + GNUNET_assert (GNUNET_OK == h->api->del (h->api->cls)); h->utilization += used; return GNUNET_OK; } |