summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-05-15 22:29:19 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-05-15 22:29:19 +0100
commit1331107fa18b0a183d313ed4852c58f52b33e5ba (patch)
tree28b0e04dbc8f059bce4ad5e11d8c4eff7635c5c8
parent871e834af7b32c66ee152344ba379c6f834242dd (diff)
downloadrspamd-1331107fa18b0a183d313ed4852c58f52b33e5ba.tar.gz
rspamd-1331107fa18b0a183d313ed4852c58f52b33e5ba.zip
[Minor] Further logging improvements
-rw-r--r--src/libutil/map.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/libutil/map.c b/src/libutil/map.c
index cd5e176e8..aefd8eb08 100644
--- a/src/libutil/map.c
+++ b/src/libutil/map.c
@@ -548,7 +548,9 @@ read_data:
r = ZSTD_decompressStream (zstream, &zout, &zin);
if (ZSTD_isError (r)) {
- msg_err_map ("cannot decompress data: %s",
+ msg_err_map ("%s(%s): cannot decompress data: %s",
+ cbd->bk->uri,
+ rspamd_inet_address_to_string_pretty (cbd->addr),
ZSTD_getErrorName (r));
ZSTD_freeDStream (zstream);
g_free (out);
@@ -565,14 +567,18 @@ read_data:
}
ZSTD_freeDStream (zstream);
- msg_info_map ("read map data from %s (%z bytes compressed, "
- "%z uncompressed)", cbd->data->host,
- dlen, zout.pos);
+ msg_info_map ("%s(%s): read map data %z bytes compressed, "
+ "%z uncompressed",
+ cbd->bk->uri,
+ rspamd_inet_address_to_string_pretty (cbd->addr),
+ dlen, zout.pos);
map->read_callback (out, zout.pos, &cbd->periodic->cbdata, TRUE);
g_free (out);
}
else {
- msg_info_map ("read map data from %s (%z bytes)", cbd->data->host,
+ msg_info_map ("%s(%s): read map data %z bytes",
+ cbd->bk->uri,
+ rspamd_inet_address_to_string_pretty (cbd->addr),
dlen);
map->read_callback (in, cbd->data_len, &cbd->periodic->cbdata, TRUE);
}
@@ -993,7 +999,8 @@ rspamd_map_read_cached (struct rspamd_map *map, struct rspamd_map_backend *bk,
r = ZSTD_decompressStream (zstream, &zout, &zin);
if (ZSTD_isError (r)) {
- msg_err_map ("cannot decompress data: %s",
+ msg_err_map ("%s: cannot decompress data: %s",
+ bk->uri,
ZSTD_getErrorName (r));
ZSTD_freeDStream (zstream);
g_free (out);
@@ -1010,14 +1017,14 @@ rspamd_map_read_cached (struct rspamd_map *map, struct rspamd_map_backend *bk,
}
ZSTD_freeDStream (zstream);
- msg_info_map ("read map data from %s (cached) (%z bytes compressed, "
- "%z uncompressed)", host,
+ msg_info_map ("%s: read map data cached %z bytes compressed, "
+ "%z uncompressed", bk->uri,
len, zout.pos);
map->read_callback (out, zout.pos, &periodic->cbdata, TRUE);
g_free (out);
}
else {
- msg_info_map ("read map data from %s (cached) (%z bytes)", host,
+ msg_info_map ("%s: read map data cached %z bytes", bk->uri,
len);
map->read_callback (in, len, &periodic->cbdata, TRUE);
}