diff --git a/project.yml b/project.yml index 4794932..bb446fd 100644 --- a/project.yml +++ b/project.yml @@ -93,7 +93,7 @@ :fetch: :method: :git :source: https://github.com/libuv/libuv.git - :tag: v1.40.0 + :tag: v1.46.0 :build: - "sh autogen.sh" - "./configure --prefix=$(pwd)/../builds/libuv/ --enable-static --disable-shared" @@ -110,7 +110,7 @@ :fetch: :method: :git :source: https://github.com/zma/zlog.git - :commit: 0f31521 + :commit: 16f266e :build: - mkdir -p tidy - cp zlog.c tidy/ @@ -129,7 +129,7 @@ :fetch: :method: :git :source: https://github.com/cofyc/argparse.git - :tag: v1.0.2 + :tag: v1.1.0 :build: - mkdir -p tidy - cp argparse.c tidy/ diff --git a/src/he/helium.c b/src/he/helium.c index f6e223a..4d40dd7 100644 --- a/src/he/helium.c +++ b/src/he/helium.c @@ -68,7 +68,7 @@ he_return_code_t nudge_time_cb(he_conn_t *client, int timeout, void *context) { } he_return_code_t server_event_cb(he_conn_t *client, he_conn_event_t event, void *context) { - zlogf_time(ZLOG_INFO_LOG_MSG, "Event occurred %d\n", event); + zlogf_time(ZLOG_INFO_LOG_MSG, "Event occurred %s\n", he_client_event_name(event)); return HE_SUCCESS; } @@ -77,7 +77,7 @@ he_return_code_t state_change_cb(he_conn_t *client, he_conn_state_t new_state, v // Get our context back lw_state_t *state = (lw_state_t *)context; - zlogf_time(ZLOG_INFO_LOG_MSG, "State changed %d\n", new_state); + zlogf_time(ZLOG_INFO_LOG_MSG, "State changed to %s\n", he_client_state_name(new_state)); if(new_state == HE_STATE_DISCONNECTED) { zlogf_time(ZLOG_INFO_LOG_MSG, "Helium connection was disconnected\n"); diff --git a/src/main.c b/src/main.c index 8c7ab7f..3748bb0 100644 --- a/src/main.c +++ b/src/main.c @@ -31,6 +31,8 @@ static const char *const usage[] = { int main(int argc, const char **argv) { // Initialise logging zlog_init_stdout(); + // Flush logs every second + zlog_init_flush_thread_with_interval(1); atexit(zlog_finish); int server = 0; diff --git a/src/udp/flow.c b/src/udp/flow.c index 4767a1c..d5fc88a 100644 --- a/src/udp/flow.c +++ b/src/udp/flow.c @@ -103,7 +103,7 @@ void on_read(uv_udp_t *handle, ssize_t nread, const uv_buf_t *buf, const struct if(res != HE_SUCCESS) { bool fatal = he_conn_is_error_fatal(state->he_conn, res); - zlogf_time(ZLOG_INFO_LOG_MSG, "Non-zero return code from libhelium: %d Fatal?: %s", res, + zlogf_time(ZLOG_INFO_LOG_MSG, "Non-zero return code from libhelium: %s Fatal?: %s", he_return_code_name(res), fatal ? "true" : "false"); if(fatal) { lw_state_disconnect(state);