Log utility module interface header file. More...
#include "mcl_core/mcl_core_common.h"
Go to the source code of this file.
Typedefs | |
typedef void(* | mcl_log_util_callback_t) (void *user_context, int log_level, const char *file, int line, const char *tag, const char *const format,...) |
Functions | |
MCL_CORE_EXPORT mcl_error_t | mcl_log_util_set_callback (mcl_log_util_callback_t callback, void *user_context) |
MCL_CORE_EXPORT mcl_error_t | mcl_log_util_set_output_level (const int log_level) |
MCL_CORE_EXPORT int | mcl_log_util_get_output_level (void) |
Variables | |
MCL_CORE_EXPORT mcl_log_util_callback_t | mcl_log_util_function |
MCL_CORE_EXPORT void * | mcl_log_util_user_context |
Log utility module interface header file.
This utility module defines macros and functions for logging purposes.
Definition in file mcl_log_util.h.
#define MCL_DEBUG | ( | ... | ) | MCL_LOG_WRITE(MCL_LOG_LEVEL_DEBUG, MCL_LOG_TAG_DEFAULT, __VA_ARGS__) |
Definition at line 114 of file mcl_log_util.h.
Referenced by _get_rsa_private_key(), _get_rsa_public_key(), _load_initial_credentials(), _request_payload_callback_for_put(), _set_in_file_size(), core_processor_destroy(), core_processor_initialize(), get_chunked_response(), get_response(), hmac_sha256(), jwt_destroy(), mcl_core_destroy(), mcl_file_util_fgets(), mcl_http_client_destroy(), mcl_http_response_destroy(), mcl_time_util_convert_to_iso_8601_format(), security_handler_base64_encode(), security_handler_base64_url_encode(), security_handler_destroy(), security_handler_hash_sha256(), security_handler_hmac_sha256(), and security_hash_sha256().
#define MCL_DEBUG_ENTRY | ( | ... | ) | MCL_LOG_WRITE(MCL_LOG_LEVEL_DEBUG, MCL_LOG_TAG_ENTRY, __VA_ARGS__) |
Definition at line 115 of file mcl_log_util.h.
Referenced by _add_jwks(), _add_key_to_keys_array(), _add_schema_to_jwt(), _base64_encode_big_number(), _calculate_signature(), _certificate_list_destroy_callback(), _check_client_secret(), _check_rsa_private_key(), _compose_access_token_request_payload(), _compose_rsa_key_rotation_json(), _compose_rsa_onboarding_json(), _convert_to_mcl_return_code(), _create_self_issued_jwt_header(), _create_self_issued_jwt_payload(), _custom_load_register_info(), _decode_quantum(), _decode_with_table(), _encode_with_table(), _generate_correlation_id_string(), _generate_token(), _get_header_and_payload_encoded_base64_url(), _get_rsa_private_key(), _get_rsa_public_key(), _is_empty_line(), _join_with_dot(), _load_initial_credentials(), _print_formatted_string(), _process_registration_response(), _process_registration_response_rsa_3072(), _process_registration_response_shared_secret(), _request_payload_callback_for_put(), _response_header_callback(), _response_payload_callback(), _save_credentials(), _set_in_file_size(), _set_payload_options(), _set_request_options(), _ssl_context_callback(), base64_decode(), base64_encode(), base64_url_decode(), base64_url_encode(), core_configuration_log(), core_configuration_validate(), core_processor_destroy(), core_processor_get_access_token(), core_processor_initialize(), core_processor_register(), core_processor_update_credentials(), get_chunked_response(), get_content_length_response(), get_response(), hmac_sha256(), json_util_initialize_json_library(), jwt_destroy(), jwt_get_token(), jwt_initialize(), mcl_core_configuration_destroy(), mcl_core_configuration_initialize(), mcl_core_configuration_set_parameter(), mcl_core_destroy(), mcl_core_get_access_token(), mcl_core_get_client_id(), mcl_core_get_host_name(), mcl_core_get_http_client(), mcl_core_get_last_access_token(), mcl_core_get_last_token_time(), mcl_core_initialize(), mcl_core_is_onboarded(), mcl_core_onboard(), mcl_core_rotate_key(), mcl_core_update_credentials(), mcl_file_util_check_if_regular_file(), mcl_file_util_fclose(), mcl_file_util_fflush(), mcl_file_util_fgets(), mcl_file_util_fopen(), mcl_file_util_fputs(), mcl_file_util_fread(), mcl_file_util_fwrite(), mcl_file_util_get_file_size(), mcl_file_util_get_time_of_last_status_change(), mcl_file_util_rewind(), mcl_http_client_add_certificate(), mcl_http_client_destroy(), mcl_http_client_initialize(), mcl_http_client_send(), mcl_http_request_add_header(), mcl_http_request_destroy(), mcl_http_request_initialize(), mcl_http_request_set_parameter(), mcl_http_response_destroy(), mcl_http_response_get_header(), mcl_http_response_get_status(), mcl_http_response_initialize(), mcl_json_util_add_bool(), mcl_json_util_add_double(), mcl_json_util_add_item_to_array(), mcl_json_util_add_null(), mcl_json_util_add_object(), mcl_json_util_add_string(), mcl_json_util_add_uint(), mcl_json_util_destroy(), mcl_json_util_duplicate(), mcl_json_util_get_array_item(), mcl_json_util_get_array_size(), mcl_json_util_get_bool_value(), mcl_json_util_get_double_value(), mcl_json_util_get_number_value(), mcl_json_util_get_object_item(), mcl_json_util_get_string(), mcl_json_util_has_child(), mcl_json_util_initialize(), mcl_json_util_library_initialize(), mcl_json_util_parse(), mcl_json_util_start_array(), mcl_json_util_start_object(), mcl_json_util_to_string(), mcl_list_add(), mcl_list_destroy(), mcl_list_destroy_with_content(), mcl_list_exist(), mcl_list_initialize(), mcl_list_next(), mcl_list_remove(), mcl_list_remove_with_content(), mcl_list_reset(), mcl_log_util_set_callback(), mcl_random_generate_bytes(), mcl_random_generate_guid(), mcl_string_util_concatenate(), mcl_string_util_find(), mcl_string_util_find_case_insensitive(), mcl_string_util_memcmp(), mcl_string_util_memcpy(), mcl_string_util_memset(), mcl_string_util_reset(), mcl_string_util_snprintf(), mcl_string_util_strdup(), mcl_string_util_strlen(), mcl_string_util_strncat(), mcl_string_util_strncmp(), mcl_string_util_strncpy(), mcl_string_util_strnlen(), mcl_string_util_strtol(), mcl_time_util_convert_to_iso_8601_format(), mcl_time_util_validate_timestamp(), mcl_tls_ca_chain_add_certificate(), mcl_tls_ca_chain_destroy(), mcl_tls_ca_chain_init(), mcl_tls_socket_connect(), mcl_tls_socket_destroy(), mcl_tls_socket_init(), mcl_tls_socket_open(), mcl_tls_socket_set_parameter(), random_generate_guid(), random_generate_number(), receive_until_lf(), security_generate_random_bytes(), security_generate_rsa_key(), security_handler_base64_decode(), security_handler_base64_encode(), security_handler_base64_url_encode(), security_handler_destroy(), security_handler_generate_jti(), security_handler_generate_rsa_key(), security_handler_hash_sha256(), security_handler_hmac_sha256(), security_handler_initialize(), security_handler_rsa_sign(), security_hash_sha256(), security_initialize(), security_rsa_get_modulus_and_exponent(), security_rsa_sign(), send_header(), send_header_list(), send_with_callback(), start_http(), string_util_concatenate(), string_util_find(), string_util_find_case_insensitive(), string_util_memcmp(), string_util_memcpy(), string_util_memset(), string_util_reset(), string_util_snprintf(), string_util_strdup(), string_util_strlen(), string_util_strncat(), string_util_strncmp(), string_util_strncpy(), string_util_strnlen(), string_util_strtol(), and time_util_get_time().
#define MCL_DEBUG_LEAVE | ( | ... | ) | MCL_LOG_WRITE(MCL_LOG_LEVEL_DEBUG, MCL_LOG_TAG_LEAVE, __VA_ARGS__) |
Definition at line 116 of file mcl_log_util.h.
Referenced by _add_jwks(), _add_key_to_keys_array(), _add_schema_to_jwt(), _base64_encode_big_number(), _calculate_signature(), _certificate_list_destroy_callback(), _check_client_secret(), _check_rsa_private_key(), _compose_access_token_request_payload(), _compose_rsa_key_rotation_json(), _compose_rsa_onboarding_json(), _convert_to_mcl_return_code(), _create_self_issued_jwt_header(), _create_self_issued_jwt_payload(), _custom_load_register_info(), _decode_quantum(), _decode_with_table(), _encode_with_table(), _generate_correlation_id_string(), _generate_token(), _get_header_and_payload_encoded_base64_url(), _get_rsa_private_key(), _get_rsa_public_key(), _is_empty_line(), _join_with_dot(), _load_initial_credentials(), _print_formatted_string(), _process_registration_response(), _process_registration_response_rsa_3072(), _process_registration_response_shared_secret(), _request_payload_callback_for_put(), _response_header_callback(), _response_payload_callback(), _save_credentials(), _set_in_file_size(), _set_payload_options(), _set_request_options(), _ssl_context_callback(), base64_decode(), base64_encode(), base64_url_decode(), base64_url_encode(), core_configuration_log(), core_configuration_validate(), core_processor_destroy(), core_processor_get_access_token(), core_processor_initialize(), core_processor_register(), core_processor_update_credentials(), get_chunked_response(), get_content_length_response(), get_response(), hmac_sha256(), json_util_initialize_json_library(), jwt_destroy(), jwt_get_token(), jwt_initialize(), mcl_core_configuration_destroy(), mcl_core_configuration_initialize(), mcl_core_configuration_set_parameter(), mcl_core_destroy(), mcl_core_get_access_token(), mcl_core_get_client_id(), mcl_core_get_host_name(), mcl_core_get_http_client(), mcl_core_get_last_access_token(), mcl_core_get_last_token_time(), mcl_core_initialize(), mcl_core_is_onboarded(), mcl_core_onboard(), mcl_core_rotate_key(), mcl_core_update_credentials(), mcl_file_util_check_if_regular_file(), mcl_file_util_fclose(), mcl_file_util_fflush(), mcl_file_util_fgets(), mcl_file_util_fopen(), mcl_file_util_fputs(), mcl_file_util_fread(), mcl_file_util_fwrite(), mcl_file_util_get_file_size(), mcl_file_util_get_time_of_last_status_change(), mcl_file_util_rewind(), mcl_http_client_add_certificate(), mcl_http_client_destroy(), mcl_http_client_initialize(), mcl_http_client_send(), mcl_http_request_add_header(), mcl_http_request_destroy(), mcl_http_request_initialize(), mcl_http_request_set_parameter(), mcl_http_response_destroy(), mcl_http_response_get_header(), mcl_http_response_get_status(), mcl_http_response_initialize(), mcl_json_util_add_bool(), mcl_json_util_add_double(), mcl_json_util_add_item_to_array(), mcl_json_util_add_null(), mcl_json_util_add_object(), mcl_json_util_add_string(), mcl_json_util_add_uint(), mcl_json_util_destroy(), mcl_json_util_duplicate(), mcl_json_util_get_array_item(), mcl_json_util_get_array_size(), mcl_json_util_get_bool_value(), mcl_json_util_get_double_value(), mcl_json_util_get_number_value(), mcl_json_util_get_object_item(), mcl_json_util_get_string(), mcl_json_util_has_child(), mcl_json_util_initialize(), mcl_json_util_library_initialize(), mcl_json_util_parse(), mcl_json_util_start_array(), mcl_json_util_start_object(), mcl_json_util_to_string(), mcl_list_add(), mcl_list_destroy(), mcl_list_destroy_with_content(), mcl_list_exist(), mcl_list_initialize(), mcl_list_next(), mcl_list_remove(), mcl_list_remove_with_content(), mcl_list_reset(), mcl_log_util_set_callback(), mcl_random_generate_bytes(), mcl_random_generate_guid(), mcl_string_util_concatenate(), mcl_string_util_find(), mcl_string_util_find_case_insensitive(), mcl_string_util_memcmp(), mcl_string_util_memcpy(), mcl_string_util_memset(), mcl_string_util_reset(), mcl_string_util_snprintf(), mcl_string_util_strdup(), mcl_string_util_strlen(), mcl_string_util_strncat(), mcl_string_util_strncmp(), mcl_string_util_strncpy(), mcl_string_util_strnlen(), mcl_string_util_strtol(), mcl_time_util_convert_to_iso_8601_format(), mcl_time_util_validate_timestamp(), mcl_tls_ca_chain_add_certificate(), mcl_tls_ca_chain_destroy(), mcl_tls_ca_chain_init(), mcl_tls_socket_connect(), mcl_tls_socket_destroy(), mcl_tls_socket_init(), mcl_tls_socket_open(), mcl_tls_socket_set_parameter(), random_generate_guid(), random_generate_number(), receive_until_lf(), security_generate_random_bytes(), security_generate_rsa_key(), security_handler_base64_decode(), security_handler_base64_encode(), security_handler_base64_url_encode(), security_handler_destroy(), security_handler_generate_jti(), security_handler_generate_rsa_key(), security_handler_hash_sha256(), security_handler_hmac_sha256(), security_handler_initialize(), security_handler_rsa_sign(), security_hash_sha256(), security_initialize(), security_rsa_get_modulus_and_exponent(), security_rsa_sign(), send_header(), send_header_list(), send_with_callback(), start_http(), string_util_concatenate(), string_util_find(), string_util_find_case_insensitive(), string_util_memcmp(), string_util_memcpy(), string_util_memset(), string_util_reset(), string_util_snprintf(), string_util_strdup(), string_util_strlen(), string_util_strncat(), string_util_strncmp(), string_util_strncpy(), string_util_strnlen(), string_util_strtol(), and time_util_get_time().
#define MCL_DEBUG_STRING | ( | string | ) | MCL_DEBUG("%s", string) |
Definition at line 117 of file mcl_log_util.h.
#define MCL_ERROR | ( | ... | ) | MCL_LOG_WRITE(MCL_LOG_LEVEL_ERROR, MCL_LOG_TAG_DEFAULT, __VA_ARGS__) |
Definition at line 142 of file mcl_log_util.h.
Referenced by _load_initial_credentials(), _print_formatted_string(), _process_registration_response(), _ssl_context_callback(), core_processor_get_access_token(), core_processor_register(), json_util_to_string(), jwt_get_token(), mcl_core_get_access_token(), mcl_core_onboard(), mcl_core_rotate_key(), mcl_file_util_fflush_without_log(), mcl_file_util_fputs(), mcl_file_util_fwrite_without_log(), mcl_file_util_get_time_of_last_status_change(), mcl_tls_socket_connect(), mcl_tls_socket_receive(), mcl_tls_socket_send(), security_handler_base64_encode(), security_handler_base64_url_encode(), security_handler_hash_sha256(), and security_handler_hmac_sha256().
#define MCL_ERROR_STRING | ( | string | ) | MCL_ERROR("%s", string) |
Definition at line 143 of file mcl_log_util.h.
Referenced by _ssl_context_callback(), get_chunked_response(), mcl_file_util_check_if_regular_file(), mcl_file_util_fclose(), mcl_file_util_fflush(), mcl_file_util_fflush_without_log(), mcl_file_util_fgets(), mcl_file_util_fopen(), mcl_file_util_fputs(), mcl_file_util_fread(), mcl_file_util_fwrite(), mcl_file_util_get_file_size(), mcl_file_util_get_time_of_last_status_change(), mcl_file_util_rewind(), mcl_http_client_initialize(), mcl_http_client_send(), and send_with_callback().
#define MCL_FATAL | ( | ... | ) | MCL_LOG_WRITE(MCL_LOG_LEVEL_FATAL, MCL_LOG_TAG_DEFAULT, __VA_ARGS__) |
Definition at line 150 of file mcl_log_util.h.
#define MCL_FATAL_STRING | ( | string | ) | MCL_FATAL("%s", string) |
Definition at line 151 of file mcl_log_util.h.
#define MCL_INFO | ( | ... | ) | MCL_LOG_WRITE(MCL_LOG_LEVEL_INFO, MCL_LOG_TAG_DEFAULT, __VA_ARGS__) |
Definition at line 126 of file mcl_log_util.h.
Referenced by _load_initial_credentials(), _process_registration_response(), _ssl_context_callback(), core_configuration_log(), core_processor_get_access_token(), core_processor_initialize(), mcl_core_get_access_token(), mcl_core_initialize(), mcl_core_onboard(), mcl_core_rotate_key(), mcl_http_client_send(), and mcl_http_response_get_status().
#define MCL_INFO_STRING | ( | string | ) | MCL_INFO("%s", string) |
Definition at line 127 of file mcl_log_util.h.
#define MCL_LOG_DISABLED (!MCL_LOG_ENABLED_COMPILE_TIME(MCL_LOG_LEVEL_FATAL)) |
Definition at line 82 of file mcl_log_util.h.
#define MCL_LOG_ENABLED_COMPILE_TIME | ( | level | ) | ((level) >= MCL_LOG_LEVEL) |
Definition at line 80 of file mcl_log_util.h.
Referenced by mcl_tls_socket_init().
#define MCL_LOG_ENABLED_RUN_TIME | ( | level | ) | ((level) >= mcl_log_util_get_output_level()) |
Definition at line 81 of file mcl_log_util.h.
Referenced by mbedtls_debug_function().
#define MCL_LOG_TAG_DEFAULT "[..]" |
Definition at line 84 of file mcl_log_util.h.
#define MCL_LOG_TAG_ENTRY "[->]" |
Definition at line 85 of file mcl_log_util.h.
#define MCL_LOG_TAG_LEAVE "[<-]" |
Definition at line 86 of file mcl_log_util.h.
#define MCL_LOG_WRITE | ( | level, | |
tag, | |||
... | |||
) |
Definition at line 94 of file mcl_log_util.h.
#define MCL_VERBOSE | ( | ... | ) | MCL_LOG_WRITE(MCL_LOG_LEVEL_VERBOSE, MCL_LOG_TAG_DEFAULT, __VA_ARGS__) |
Definition at line 102 of file mcl_log_util.h.
Referenced by _decode_quantum(), _decode_with_table(), json_util_initialize(), mcl_list_add(), mcl_list_destroy_with_content(), mcl_list_remove(), and mcl_list_reset().
#define MCL_VERBOSE_ENTRY | ( | ... | ) | MCL_LOG_WRITE(MCL_LOG_LEVEL_VERBOSE, MCL_LOG_TAG_ENTRY, __VA_ARGS__) |
Definition at line 103 of file mcl_log_util.h.
Referenced by _add_number(), _libcrypto_free(), _libcrypto_malloc(), _libcrypto_realloc(), json_util_add_bool(), json_util_add_double(), json_util_add_item_to_array(), json_util_add_null(), json_util_add_object(), json_util_add_string(), json_util_add_uint(), json_util_destroy(), json_util_duplicate(), json_util_get_array_item(), json_util_get_array_size(), json_util_get_bool_value(), json_util_get_double_value(), json_util_get_number_value(), json_util_get_object_item(), json_util_get_string(), json_util_has_child(), json_util_initialize(), json_util_parse(), json_util_start_array(), json_util_start_object(), json_util_to_string(), mcl_tls_socket_receive(), mcl_tls_socket_send(), receive_to_buffer(), and send_buffer().
#define MCL_VERBOSE_LEAVE | ( | ... | ) | MCL_LOG_WRITE(MCL_LOG_LEVEL_VERBOSE, MCL_LOG_TAG_LEAVE, __VA_ARGS__) |
Definition at line 104 of file mcl_log_util.h.
Referenced by _add_number(), _libcrypto_free(), _libcrypto_malloc(), _libcrypto_realloc(), json_util_add_bool(), json_util_add_double(), json_util_add_item_to_array(), json_util_add_null(), json_util_add_object(), json_util_add_string(), json_util_add_uint(), json_util_destroy(), json_util_duplicate(), json_util_get_array_item(), json_util_get_array_size(), json_util_get_bool_value(), json_util_get_double_value(), json_util_get_number_value(), json_util_get_object_item(), json_util_get_string(), json_util_has_child(), json_util_initialize(), json_util_parse(), json_util_start_array(), json_util_start_object(), json_util_to_string(), mcl_tls_socket_receive(), mcl_tls_socket_send(), receive_to_buffer(), and send_buffer().
#define MCL_VERBOSE_STRING | ( | string | ) | MCL_VERBOSE("%s", string) |
Definition at line 105 of file mcl_log_util.h.
#define MCL_WARN | ( | ... | ) | MCL_LOG_WRITE(MCL_LOG_LEVEL_WARN, MCL_LOG_TAG_DEFAULT, __VA_ARGS__) |
Definition at line 134 of file mcl_log_util.h.
Referenced by _save_credentials().
#define MCL_WARN_STRING | ( | string | ) | MCL_WARN("%s", string) |
Definition at line 135 of file mcl_log_util.h.
typedef void(* mcl_log_util_callback_t) (void *user_context, int log_level, const char *file, int line, const char *tag, const char *const format,...) |
Log utility callback function definition.
[in] | user_context | User's own context. |
[in] | log_level | Log level. |
[in] | file | File where log function is called. |
[in] | line | Line number. |
[in] | tag | Message tag. |
[in] | format | Message format. |
Definition at line 31 of file mcl_log_util.h.
MCL_CORE_EXPORT int mcl_log_util_get_output_level | ( | void | ) |
This function is used to get log output level.
Definition at line 51 of file log_util.c.
References _mcl_log_level, and MCL_LOG_LEVEL_NONE.
MCL_CORE_EXPORT mcl_error_t mcl_log_util_set_callback | ( | mcl_log_util_callback_t | callback, |
void * | user_context | ||
) |
This function is used to set callback function for log utility.
[in] | callback | Callback function. |
[in] | user_context | User context argument. |
callback
is null. Definition at line 60 of file log_util.c.
References MCL_ASSERT_NOT_NULL, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_FAIL, MCL_FUNCTION_LEAVE_LABEL, mcl_log_util_function, mcl_log_util_user_context, and MCL_OK.
MCL_CORE_EXPORT mcl_error_t mcl_log_util_set_output_level | ( | const int | log_level | ) |
This function sets the output level. The output level is used during runtime check. No logs are written if given log level is below this output level.
[in] | log_level | The output level to set with. Following log levels can be set.
|
Definition at line 33 of file log_util.c.
References _mcl_log_level, MCL_INVALID_LOG_LEVEL, MCL_LOG_LEVEL, MCL_LOG_LEVEL_FATAL, MCL_LOG_LEVEL_NONE, and MCL_OK.
MCL_CORE_EXPORT mcl_log_util_callback_t mcl_log_util_function |
Definition at line 19 of file log_util.c.
Referenced by mbedtls_debug_function(), and mcl_log_util_set_callback().
MCL_CORE_EXPORT void* mcl_log_util_user_context |
Definition at line 20 of file log_util.c.
Referenced by mbedtls_debug_function(), and mcl_log_util_set_callback().