diff options
author | Carlo Cabrera <30379873+carlocab@users.noreply.github.com> | 2023-07-01 05:14:26 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-30 21:14:26 +0000 |
commit | 5b56f09dbcfa159605268e731c02734486530507 (patch) | |
tree | 885958d2c176c0c328e5ac8749073a071a4380b2 /aclk | |
parent | b51c4278dd251c45daba5d2f457755da936651e3 (diff) |
Replace `info` macro with a less generic name (#15266)
Diffstat (limited to 'aclk')
-rw-r--r-- | aclk/aclk.c | 34 | ||||
-rw-r--r-- | aclk/aclk_otp.c | 6 | ||||
-rw-r--r-- | aclk/aclk_query.c | 2 | ||||
-rw-r--r-- | aclk/aclk_rx_msgs.c | 4 | ||||
-rw-r--r-- | aclk/https_client.c | 4 |
5 files changed, 25 insertions, 25 deletions
diff --git a/aclk/aclk.c b/aclk/aclk.c index d7ed3315f7..3ff5515684 100644 --- a/aclk/aclk.c +++ b/aclk/aclk.c @@ -154,7 +154,7 @@ biofailed: static int wait_till_cloud_enabled() { - info("Waiting for Cloud to be enabled"); + netdata_log_info("Waiting for Cloud to be enabled"); while (!netdata_cloud_enabled) { sleep_usec(USEC_PER_SEC * 1); if (!service_running(SERVICE_ACLK)) @@ -237,7 +237,7 @@ void aclk_mqtt_wss_log_cb(mqtt_wss_log_type_t log_type, const char* str) error_report("%s", str); return; case MQTT_WSS_LOG_INFO: - info("%s", str); + netdata_log_info("%s", str); return; case MQTT_WSS_LOG_DEBUG: debug(D_ACLK, "%s", str); @@ -297,7 +297,7 @@ static void puback_callback(uint16_t packet_id) #endif if (aclk_shared_state.mqtt_shutdown_msg_id == (int)packet_id) { - info("Shutdown message has been acknowledged by the cloud. Exiting gracefully"); + netdata_log_info("Shutdown message has been acknowledged by the cloud. Exiting gracefully"); aclk_shared_state.mqtt_shutdown_msg_rcvd = 1; } } @@ -335,7 +335,7 @@ static int handle_connection(mqtt_wss_client client) } if (disconnect_req || aclk_kill_link) { - info("Going to restart connection due to disconnect_req=%s (cloud req), aclk_kill_link=%s (reclaim)", + netdata_log_info("Going to restart connection due to disconnect_req=%s (cloud req), aclk_kill_link=%s (reclaim)", disconnect_req ? "true" : "false", aclk_kill_link ? "true" : "false"); disconnect_req = 0; @@ -390,7 +390,7 @@ static inline void mqtt_connected_actions(mqtt_wss_client client) void aclk_graceful_disconnect(mqtt_wss_client client) { - info("Preparing to gracefully shutdown ACLK connection"); + netdata_log_info("Preparing to gracefully shutdown ACLK connection"); aclk_queue_lock(); aclk_queue_flush(); @@ -403,17 +403,17 @@ void aclk_graceful_disconnect(mqtt_wss_client client) break; } if (aclk_shared_state.mqtt_shutdown_msg_rcvd) { - info("MQTT App Layer `disconnect` message sent successfully"); + netdata_log_info("MQTT App Layer `disconnect` message sent successfully"); break; } } - info("ACLK link is down"); + netdata_log_info("ACLK link is down"); log_access("ACLK DISCONNECTED"); aclk_stats_upd_online(0); last_disconnect_time = now_realtime_sec(); aclk_connected = 0; - info("Attempting to gracefully shutdown the MQTT/WSS connection"); + netdata_log_info("Attempting to gracefully shutdown the MQTT/WSS connection"); mqtt_wss_disconnect(client, 1000); } @@ -455,7 +455,7 @@ static int aclk_block_till_recon_allowed() { next_connection_attempt = now_realtime_sec() + (recon_delay / MSEC_PER_SEC); last_backoff_value = (float)recon_delay / MSEC_PER_SEC; - info("Wait before attempting to reconnect in %.3f seconds", recon_delay / (float)MSEC_PER_SEC); + netdata_log_info("Wait before attempting to reconnect in %.3f seconds", recon_delay / (float)MSEC_PER_SEC); // we want to wake up from time to time to check netdata_exit while (recon_delay) { @@ -593,7 +593,7 @@ static int aclk_attempt_to_connect(mqtt_wss_client client) return 1; } - info("Attempting connection now"); + netdata_log_info("Attempting connection now"); memset(&base_url, 0, sizeof(url_t)); if (url_parse(aclk_cloud_base_url, &base_url)) { aclk_status = ACLK_STATUS_INVALID_CLOUD_URL; @@ -680,7 +680,7 @@ static int aclk_attempt_to_connect(mqtt_wss_client client) error_report("Can't use encoding=proto without at least \"proto\" capability."); continue; } - info("New ACLK protobuf protocol negotiated successfully (/env response)."); + netdata_log_info("New ACLK protobuf protocol negotiated successfully (/env response)."); memset(&auth_url, 0, sizeof(url_t)); if (url_parse(aclk_env->auth_endpoint, &auth_url)) { @@ -750,7 +750,7 @@ static int aclk_attempt_to_connect(mqtt_wss_client client) if (!ret) { last_conn_time_mqtt = now_realtime_sec(); - info("ACLK connection successfully established"); + netdata_log_info("ACLK connection successfully established"); aclk_status = ACLK_STATUS_CONNECTED; log_access("ACLK CONNECTED"); mqtt_connected_actions(client); @@ -798,7 +798,7 @@ void *aclk_main(void *ptr) netdata_thread_disable_cancelability(); #if defined( DISABLE_CLOUD ) || !defined( ENABLE_ACLK ) - info("Killing ACLK thread -> cloud functionality has been disabled"); + netdata_log_info("Killing ACLK thread -> cloud functionality has been disabled"); static_thread->enabled = NETDATA_MAIN_THREAD_EXITED; return NULL; #endif @@ -924,7 +924,7 @@ void aclk_host_state_update(RRDHOST *host, int cmd) rrdhost_aclk_state_unlock(localhost); create_query->data.bin_payload.topic = ACLK_TOPICID_CREATE_NODE; create_query->data.bin_payload.msg_name = "CreateNodeInstance"; - info("Registering host=%s, hops=%u", host->machine_guid, host->system_info->hops); + netdata_log_info("Registering host=%s, hops=%u", host->machine_guid, host->system_info->hops); aclk_queue_query(create_query); return; } @@ -947,7 +947,7 @@ void aclk_host_state_update(RRDHOST *host, int cmd) query->data.bin_payload.payload = generate_node_instance_connection(&query->data.bin_payload.size, &node_state_update); rrdhost_aclk_state_unlock(localhost); - info("Queuing status update for node=%s, live=%d, hops=%u",(char*)node_state_update.node_id, cmd, + netdata_log_info("Queuing status update for node=%s, live=%d, hops=%u",(char*)node_state_update.node_id, cmd, host->system_info->hops); freez((void*)node_state_update.node_id); query->data.bin_payload.msg_name = "UpdateNodeInstanceConnection"; @@ -990,7 +990,7 @@ void aclk_send_node_instances() node_state_update.claim_id = localhost->aclk_state.claimed_id; query->data.bin_payload.payload = generate_node_instance_connection(&query->data.bin_payload.size, &node_state_update); rrdhost_aclk_state_unlock(localhost); - info("Queuing status update for node=%s, live=%d, hops=%d",(char*)node_state_update.node_id, + netdata_log_info("Queuing status update for node=%s, live=%d, hops=%d",(char*)node_state_update.node_id, list->live, list->hops); @@ -1014,7 +1014,7 @@ void aclk_send_node_instances() node_instance_creation.claim_id = localhost->aclk_state.claimed_id, create_query->data.bin_payload.payload = generate_node_instance_creation(&create_query->data.bin_payload.size, &node_instance_creation); rrdhost_aclk_state_unlock(localhost); - info("Queuing registration for host=%s, hops=%d",(char*)node_instance_creation.machine_guid, + netdata_log_info("Queuing registration for host=%s, hops=%d",(char*)node_instance_creation.machine_guid, list->hops); freez((void *)node_instance_creation.machine_guid); aclk_queue_query(create_query); diff --git a/aclk/aclk_otp.c b/aclk/aclk_otp.c index a0a85b6c2c..a37c0bb9c2 100644 --- a/aclk/aclk_otp.c +++ b/aclk/aclk_otp.c @@ -335,7 +335,7 @@ int aclk_get_otp_challenge(url_t *target, const char *agent_id, unsigned char ** } buffer_free(url); - info ("ACLK_OTP Got Challenge from Cloud"); + netdata_log_info("ACLK_OTP Got Challenge from Cloud"); json_object *json = json_tokener_parse(resp.payload); if (!json) { @@ -414,7 +414,7 @@ int aclk_send_otp_response(const char *agent_id, const unsigned char *response, aclk_parse_otp_error(resp.payload); goto cleanup_response; } - info ("ACLK_OTP Got Password from Cloud"); + netdata_log_info("ACLK_OTP Got Password from Cloud"); if (parse_passwd_response(resp.payload, mqtt_auth)){ error("Error parsing response of password endpoint"); @@ -871,7 +871,7 @@ int aclk_get_env(aclk_env_t *env, const char* aclk_hostname, int aclk_port) { return 5; } - info("Getting Cloud /env successful"); + netdata_log_info("Getting Cloud /env successful"); https_req_response_free(&resp); buffer_free(buf); diff --git a/aclk/aclk_query.c b/aclk/aclk_query.c index ad3756ccda..c640d0b701 100644 --- a/aclk/aclk_query.c +++ b/aclk/aclk_query.c @@ -357,7 +357,7 @@ void *aclk_query_main_thread(void *ptr) #define TASK_LEN_MAX 22 void aclk_query_threads_start(struct aclk_query_threads *query_threads, mqtt_wss_client client) { - info("Starting %d query threads.", query_threads->count); + netdata_log_info("Starting %d query threads.", query_threads->count); char thread_name[TASK_LEN_MAX]; query_threads->thread_list = callocz(query_threads->count, sizeof(struct aclk_query_thread)); diff --git a/aclk/aclk_rx_msgs.c b/aclk/aclk_rx_msgs.c index 60bff9ba1f..96c70d7571 100644 --- a/aclk/aclk_rx_msgs.c +++ b/aclk/aclk_rx_msgs.c @@ -399,10 +399,10 @@ int handle_disconnect_req(const char *msg, size_t msg_len) error("Cloud Banned This Agent!"); aclk_disable_runtime = 1; } - info("Cloud requested disconnect (EC=%u, \"%s\")", (unsigned int)cmd->error_code, cmd->error_description); + netdata_log_info("Cloud requested disconnect (EC=%u, \"%s\")", (unsigned int)cmd->error_code, cmd->error_description); if (cmd->reconnect_after_s > 0) { aclk_block_until = now_monotonic_sec() + cmd->reconnect_after_s; - info( + netdata_log_info( "Cloud asks not to reconnect for %u seconds. We shall honor that request", (unsigned int)cmd->reconnect_after_s); } diff --git a/aclk/https_client.c b/aclk/https_client.c index 345cf65a81..9df935da49 100644 --- a/aclk/https_client.c +++ b/aclk/https_client.c @@ -524,7 +524,7 @@ int https_request(https_req_t *request, https_req_response_t *response) { error("Proxy didn't return 200 OK (got %d)", ctx->parse_ctx.http_code); goto exit_sock; } - info("Proxy accepted CONNECT upgrade"); + netdata_log_info("Proxy accepted CONNECT upgrade"); } ctx->request = request; @@ -584,7 +584,7 @@ int https_request(https_req_t *request, https_req_response_t *response) { // only exact data without affixed 0x00 ((char*)response->payload)[response->payload_size] = 0; // mallocz(response->payload_size + 1); } - info("HTTPS \"%s\" request to \"%s\" finished with HTTP code: %d", http_req_type_to_str(ctx->request->request_type), ctx->request->host, response->http_code); + netdata_log_info("HTTPS \"%s\" request to \"%s\" finished with HTTP code: %d", http_req_type_to_str(ctx->request->request_type), ctx->request->host, response->http_code); rc = 0; |