From 55a7b79cc79f88c1c478fb401ae0d2f5be92b7e5 Mon Sep 17 00:00:00 2001 From: Alberto Miranda Date: Mon, 19 Sep 2022 13:07:33 +0200 Subject: [PATCH 1/2] Fix inconsistent formatting in RPC logging --- src/lib/detail/impl.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/lib/detail/impl.cpp b/src/lib/detail/impl.cpp index 2130ed15..fe76b27e 100644 --- a/src/lib/detail/impl.cpp +++ b/src/lib/detail/impl.cpp @@ -177,7 +177,7 @@ register_job(const admire::server& srv, const admire::job_requirements& reqs) { auto endp = rpc_client.lookup(srv.address()); - LOGGER_INFO("RPC (ADM_{}) <= {{job_requirements: {}}}", __FUNCTION__, reqs); + LOGGER_INFO("RPC (ADM_{}) => {{job_requirements: {}}}", __FUNCTION__, reqs); auto rpc_reqs = api::convert(reqs); @@ -187,13 +187,13 @@ register_job(const admire::server& srv, const admire::job_requirements& reqs) { const auto rpc = endp.call("ADM_register_job", &in, &out); if(out.retval < 0) { - LOGGER_ERROR("RPC (ADM_{}) => {}", __FUNCTION__, out.retval); + LOGGER_ERROR("RPC (ADM_{}) <= {}", __FUNCTION__, out.retval); return tl::make_unexpected(static_cast(out.retval)); } const admire::job job = api::convert(out.job); - LOGGER_INFO("RPC (ADM_{}) => {{retval: {}, job: {}}}", __FUNCTION__, + LOGGER_INFO("RPC (ADM_{}) <= {{retval: {}, job: {}}}", __FUNCTION__, ADM_SUCCESS, job.id()); return job; @@ -206,8 +206,8 @@ update_job(const server& srv, const job& job, const job_requirements& reqs) { auto endp = rpc_client.lookup(srv.address()); - LOGGER_INFO("RPC (ADM_{}): {{job: {}, job_requirements: {}}}", __FUNCTION__, - job, reqs); + LOGGER_INFO("RPC (ADM_{}) => {{job: {}, job_requirements: {}}}", + __FUNCTION__, job, reqs); const auto rpc_job = api::convert(job); const auto rpc_reqs = api::convert(reqs); @@ -220,11 +220,11 @@ update_job(const server& srv, const job& job, const job_requirements& reqs) { if(out.retval < 0) { const auto retval = static_cast(out.retval); - LOGGER_ERROR("RPC (ADM_{}) => {{retval: {}}}", __FUNCTION__, retval); + LOGGER_ERROR("RPC (ADM_{}) <= {{retval: {}}}", __FUNCTION__, retval); return retval; } - LOGGER_INFO("RPC (ADM_{}) => {{retval: {}}}", __FUNCTION__, ADM_SUCCESS); + LOGGER_INFO("RPC (ADM_{}) <= {{retval: {}}}", __FUNCTION__, ADM_SUCCESS); return ADM_SUCCESS; } @@ -235,7 +235,7 @@ remove_job(const server& srv, const job& job) { auto endp = rpc_client.lookup(srv.address()); - LOGGER_INFO("RPC (ADM_{}) <= {{job: {}}}", __FUNCTION__, job); + LOGGER_INFO("RPC (ADM_{}) => {{job: {}}}", __FUNCTION__, job); const auto rpc_job = api::convert(job); @@ -246,11 +246,11 @@ remove_job(const server& srv, const job& job) { if(out.retval < 0) { const auto retval = static_cast(out.retval); - LOGGER_ERROR("RPC (ADM_{}) => {{retval: {}}}", __FUNCTION__, retval); + LOGGER_ERROR("RPC (ADM_{}) <= {{retval: {}}}", __FUNCTION__, retval); return retval; } - LOGGER_INFO("RPC (ADM_{}) => {{retval: {}}}", __FUNCTION__, ADM_SUCCESS); + LOGGER_INFO("RPC (ADM_{}) <= {{retval: {}}}", __FUNCTION__, ADM_SUCCESS); return ADM_SUCCESS; } @@ -265,7 +265,7 @@ transfer_datasets(const server& srv, const job& job, auto endp = rpc_client.lookup(srv.address()); - LOGGER_INFO("RPC (ADM_{}) <= {{job: {}, sources: {}, targets: {}, " + LOGGER_INFO("RPC (ADM_{}) => {{job: {}, sources: {}, targets: {}, " "limits: {}, mapping: {}}}", __FUNCTION__, job, sources, targets, limits, mapping); @@ -283,14 +283,14 @@ transfer_datasets(const server& srv, const job& job, endp.call("ADM_transfer_datasets", &in, &out); if(out.retval < 0) { - LOGGER_ERROR("RPC (ADM_{}) => {{retval: {}}}", __FUNCTION__, + LOGGER_ERROR("RPC (ADM_{}) <= {{retval: {}}}", __FUNCTION__, out.retval); return tl::make_unexpected(static_cast(out.retval)); } const admire::transfer tx = api::convert(out.tx); - LOGGER_INFO("RPC (ADM_{}) => {{retval: {}, transfer: {}}}", __FUNCTION__, + LOGGER_INFO("RPC (ADM_{}) <= {{retval: {}, transfer: {}}}", __FUNCTION__, ADM_SUCCESS, tx); return tx; } -- GitLab From e7413aab20bbf3b67ffce3f79f54f63c757e70a3 Mon Sep 17 00:00:00 2001 From: Alberto Miranda Date: Mon, 19 Sep 2022 13:16:35 +0200 Subject: [PATCH 2/2] Fix wrong logging messages in ADM_ping RPC --- src/lib/detail/impl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/detail/impl.cpp b/src/lib/detail/impl.cpp index fe76b27e..f6272850 100644 --- a/src/lib/detail/impl.cpp +++ b/src/lib/detail/impl.cpp @@ -163,10 +163,10 @@ ping(const server& srv) { auto endp = rpc_client.lookup(srv.address()); - LOGGER_INFO("ADM_ping()"); + LOGGER_INFO("RPC (ADM_{}) => {{}}", __FUNCTION__); const auto rpc = endp.call("ADM_ping"); - LOGGER_INFO("ADM_register_job() = {}", ADM_SUCCESS); + LOGGER_INFO("RPC (ADM_{}) <= {{ retval: {}}}", __FUNCTION__, ADM_SUCCESS); return ADM_SUCCESS; } -- GitLab