diff options
author | Max Romanov <max.romanov@nginx.com> | 2020-11-18 22:33:53 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2020-11-18 22:33:53 +0300 |
commit | 8340ca0b9c7ad4109033ccb028f87cc1b73396bc (patch) | |
tree | 08c5c76b11c3271ce2dff14c61c3b7535cf014e8 /src/test | |
parent | fb80502513bf0140c5e595714967f75ea3e1e5d3 (diff) | |
download | unit-8340ca0b9c7ad4109033ccb028f87cc1b73396bc.tar.gz unit-8340ca0b9c7ad4109033ccb028f87cc1b73396bc.tar.bz2 |
Libunit: improving logging consistency.
Debug logging depends on macros defined in nxt_auto_config.h.
Diffstat (limited to '')
-rw-r--r-- | src/test/nxt_unit_app_test.c | 2 | ||||
-rw-r--r-- | src/test/nxt_unit_websocket_chat.c | 8 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/test/nxt_unit_app_test.c b/src/test/nxt_unit_app_test.c index b6dd13d2..a5f3728c 100644 --- a/src/test/nxt_unit_app_test.c +++ b/src/test/nxt_unit_app_test.c @@ -3,8 +3,6 @@ * Copyright (C) NGINX, Inc. */ -#include <nxt_auto_config.h> -#include <nxt_version.h> #include <nxt_unit.h> #include <nxt_unit_request.h> #include <nxt_clang.h> diff --git a/src/test/nxt_unit_websocket_chat.c b/src/test/nxt_unit_websocket_chat.c index 6e274722..39f8a440 100644 --- a/src/test/nxt_unit_websocket_chat.c +++ b/src/test/nxt_unit_websocket_chat.c @@ -30,7 +30,7 @@ typedef struct { static int ws_chat_root(nxt_unit_request_info_t *req); -static void ws_chat_broadcast(const void *buf, size_t size); +static void ws_chat_broadcast(const char *buf, size_t size); static const char ws_chat_index_html[]; @@ -139,18 +139,18 @@ ws_chat_root(nxt_unit_request_info_t *req) static void -ws_chat_broadcast(const void *buf, size_t size) +ws_chat_broadcast(const char *buf, size_t size) { ws_chat_request_data_t *data; nxt_unit_request_info_t *req; - nxt_unit_debug(NULL, "broadcast: %s", buf); + nxt_unit_debug(NULL, "broadcast: %*.s", (int) size, buf); nxt_queue_each(data, &ws_chat_sessions, ws_chat_request_data_t, link) { req = nxt_unit_get_request_info_from_data(data); - nxt_unit_req_debug(req, "broadcast: %s", buf); + nxt_unit_req_debug(req, "send: %*.s", (int) size, buf); nxt_unit_websocket_send(req, NXT_WEBSOCKET_OP_TEXT, 1, buf, size); } nxt_queue_loop; |