Asterisk - The Open Source Telephony Project
21.4.1
|
Support for logging to various files, console and syslog Configuration in file logger.conf. More...
#include "asterisk/options.h"
Go to the source code of this file.
Macros | |
#define | __LOG_DEBUG 0 |
#define | __LOG_DTMF 6 |
#define | __LOG_ERROR 4 |
#define | __LOG_NOTICE 2 |
#define | __LOG_TRACE 1 |
#define | __LOG_VERBOSE 5 |
#define | __LOG_WARNING 3 |
#define | _A_ __FILE__, __LINE__, __FUNCTION__ |
#define | _TRACE_PREFIX_ _TRACE_PREFIX_DEFAULT_ |
#define | _TRACE_PREFIX_DEFAULT_ _A_ |
#define | AST_CALLID_BUFFER_LENGTH 13 |
#define | ast_debug(level, ...) |
Log a DEBUG message. More... | |
#define | AST_LOG_DEBUG __LOG_DEBUG, _A_ |
#define | AST_LOG_DTMF __LOG_DTMF, _A_ |
#define | ast_log_dynamic_level(level, ...) ast_log(level, _A_, __VA_ARGS__) |
Send a log message to a dynamically registered log level. More... | |
#define | AST_LOG_ERROR __LOG_ERROR, _A_ |
#define | AST_LOG_NOTICE __LOG_NOTICE, _A_ |
#define | AST_LOG_TRACE __LOG_TRACE, _A_ |
#define | AST_LOG_VERBOSE __LOG_VERBOSE, _A_ |
#define | AST_LOG_WARNING __LOG_WARNING, _A_ |
#define | ast_trace(level, ...) ast_debug(level < 0 ? __scope_level : level, " " __VA_ARGS__) |
#define | ast_trace_dec_indent() |
#define | ast_trace_get_indent() (0) |
#define | ast_trace_inc_indent() |
#define | ast_trace_log(__level, __log_level, ...) |
#define | ast_trace_raw(level, indent_type, ...) ast_debug(level < 0 ? __scope_level : level, " " __VA_ARGS__) |
#define | ast_trace_set_indent(indent) |
#define | ast_verb(level, ...) |
#define | ast_verb_callid(level, callid, ...) |
#define | ast_verbose(...) __ast_verbose(_A_, -1, __VA_ARGS__) |
#define | ast_verbose_callid(callid, ...) __ast_verbose_callid(_A_, -1, callid, __VA_ARGS__) |
#define | DEBUG_ATLEAST(level) |
#define | DEBUG_M(a) |
#define | EVENTLOG "event_log" |
#define | LOG_DEBUG __LOG_DEBUG, _A_ |
#define | LOG_DTMF __LOG_DTMF, _A_ |
#define | LOG_ERROR __LOG_ERROR, _A_ |
#define | LOG_NOTICE __LOG_NOTICE, _A_ |
#define | LOG_TRACE __LOG_TRACE, _A_ |
#define | LOG_VERBOSE __LOG_VERBOSE, _A_ |
#define | LOG_WARNING __LOG_WARNING, _A_ |
#define | NUMLOGLEVELS 32 |
#define | QUEUELOG "queue_log" |
#define | SCOPE_CALL(level, __funcname, ...) __funcname(__VA_ARGS__) |
#define | SCOPE_CALL_WITH_INT_RESULT(level, __funcname, ...) __funcname(__VA_ARGS__) |
#define | SCOPE_CALL_WITH_RESULT(level, __var, __funcname, ...) __var = __funcname(__VA_ARGS__) |
#define | SCOPE_ENTER(level, ...) |
#define | SCOPE_ENTER_TASK(level, indent, ...) |
#define | SCOPE_EXIT(...) ast_debug(__scope_level, " " __VA_ARGS__) |
#define | SCOPE_EXIT_EXPR(__expr, ...) |
#define | SCOPE_EXIT_LOG(__log_level, ...) |
#define | SCOPE_EXIT_LOG_EXPR(__expr, __log_level, ...) |
#define | SCOPE_EXIT_LOG_RTN(__log_level, ...) |
#define | SCOPE_EXIT_LOG_RTN_VALUE(__value, __log_level, ...) |
#define | SCOPE_EXIT_RTN(...) |
#define | SCOPE_EXIT_RTN_VALUE(__return_value, ...) |
#define | SCOPE_TRACE(__level, ...) |
#define | TRACE_ATLEAST(level) |
#define | VERBOSE_HASMAGIC(x) (*(signed char *) (x) < 0) |
#define | VERBOSE_MAGIC2LEVEL(x) (((char) -*(signed char *) (x)) - 1) |
#define | VERBOSE_PREFIX_1 " " |
#define | VERBOSE_PREFIX_10 " > " |
#define | VERBOSE_PREFIX_2 " == " |
#define | VERBOSE_PREFIX_3 " -- " |
#define | VERBOSE_PREFIX_4 " > " |
#define | VERBOSE_PREFIX_5 " > " |
#define | VERBOSE_PREFIX_6 " > " |
#define | VERBOSE_PREFIX_7 " > " |
#define | VERBOSE_PREFIX_8 " > " |
#define | VERBOSE_PREFIX_9 " > " |
#define | VERBOSITY_ATLEAST(level) ((level) <= ast_verb_sys_level) |
Typedefs | |
typedef unsigned int | ast_callid |
Enumerations | |
enum | ast_logger_results { AST_LOGGER_SUCCESS = 0, AST_LOGGER_FAILURE = 1, AST_LOGGER_DECLINE = -1, AST_LOGGER_ALLOC_ERROR = -2 } |
enum | ast_trace_indent_type { AST_TRACE_INDENT_SAME = 0, AST_TRACE_INDENT_INC_BEFORE, AST_TRACE_INDENT_INC_AFTER, AST_TRACE_INDENT_DEC_BEFORE, AST_TRACE_INDENT_DEC_AFTER, AST_TRACE_INDENT_PROVIDED, AST_TRACE_INDENT_NONE } |
Controls if and when indenting is applied. More... | |
Functions | |
void | __ast_verbose (const char *file, int line, const char *func, int level, const char *fmt,...) |
Send a verbose message (based on verbose level) More... | |
void | __ast_verbose_ap (const char *file, int line, const char *func, int level, ast_callid callid, const char *fmt, va_list ap) |
void | __ast_verbose_callid (const char *file, int line, const char *func, int level, ast_callid callid, const char *fmt,...) |
Send a verbose message (based on verbose level) with deliberately specified callid. More... | |
void | ast_callid_strnprint (char *buffer, size_t buffer_size, ast_callid callid) |
copy a string representation of the callid into a target string More... | |
int | ast_callid_threadassoc_add (ast_callid callid) |
Adds a known callid to thread storage of the calling thread. More... | |
int | ast_callid_threadassoc_change (ast_callid callid) |
Sets what is stored in the thread storage to the given callid if it does not match what is already there. More... | |
int | ast_callid_threadassoc_remove (void) |
Removes callid from thread storage of the calling thread. More... | |
int | ast_callid_threadstorage_auto (ast_callid *callid) |
Checks thread storage for a callid and stores a reference if it exists. If not, then a new one will be created, bound to the thread, and a reference to it will be stored. More... | |
void | ast_callid_threadstorage_auto_clean (ast_callid callid, int callid_created) |
Use in conjunction with ast_callid_threadstorage_auto. Cleans up the references and if the callid was created by threadstorage_auto, unbinds the callid from the threadstorage. More... | |
void | ast_child_verbose (int level, const char *fmt,...) |
void | ast_console_puts (const char *string) |
write the string to the root console, and all attached network console clients | |
void | ast_console_puts_mutable (const char *string, int level) |
log the string to the console, and all attached console clients More... | |
void | ast_console_puts_mutable_full (const char *message, int level, int sublevel) |
log the string to the console, and all attached console clients More... | |
void | ast_console_toggle_loglevel (int fd, int level, int state) |
enables or disables logging of a specified level to the console fd specifies the index of the console receiving the level change level specifies the index of the logging level being toggled state indicates whether logging will be on or off (0 for off, 1 for on) More... | |
void | ast_console_toggle_mute (int fd, int silent) |
mute or unmute a console from logging | |
ast_callid | ast_create_callid (void) |
factory function to create a new uniquely identifying callid. More... | |
unsigned int | ast_debug_get_by_module (const char *module) |
Get the debug level for a module. More... | |
void | ast_init_logger_for_socket_console (void) |
load logger.conf configuration for console socket connections | |
int | ast_is_logger_initialized (void) |
Test if logger is initialized. More... | |
void | ast_log (int level, const char *file, int line, const char *function, const char *fmt,...) |
Used for sending a log message This is the standard logger function. Probably the only way you will invoke it would be something like this: ast_log(AST_LOG_WHATEVER, "Problem with the %s Captain. We should get some more. Will %d be enough?\n", "flux capacitor", 10); where WHATEVER is one of ERROR, DEBUG, EVENT, NOTICE, or WARNING depending on which log you wish to output to. These are implemented as macros, that will provide the function with the needed arguments. More... | |
void | ast_log_ap (int level, const char *file, int line, const char *function, const char *fmt, va_list ap) |
void | ast_log_backtrace (void) |
Log a backtrace of the current thread's execution stack to the Asterisk log. | |
void | ast_log_callid (int level, const char *file, int line, const char *function, ast_callid callid, const char *fmt,...) |
Used for sending a log message with a known call_id This is a modified logger function which is functionally identical to the above logger function, it just include a call_id argument as well. If NULL is specified here, no attempt will be made to join the log message with a call_id. More... | |
void | ast_log_safe (int level, const char *file, int line, const char *function, const char *fmt,...) |
Used for sending a log message with protection against recursion. More... | |
int | ast_logger_create_channel (const char *log_channel, const char *components) |
Create a log channel. More... | |
int | ast_logger_get_channels (int(*logentry)(const char *channel, const char *type, const char *status, const char *configuration, void *data), void *data) |
Retrieve the existing log channels. More... | |
const char * | ast_logger_get_dateformat (void) |
Get the logger configured date format. More... | |
int | ast_logger_get_dynamic_level (const char *name) |
Retrieve dynamic logging level id. More... | |
int | ast_logger_get_queue_limit (void) |
Get the maximum number of messages allowed in the processing queue. More... | |
int | ast_logger_register_level (const char *name) |
Register a new logger level. More... | |
int | ast_logger_remove_channel (const char *log_channel) |
Delete the specified log channel. More... | |
int | ast_logger_rotate (void) |
Reload logger while rotating log files. | |
int | ast_logger_rotate_channel (const char *log_channel) |
Rotate the specified log channel. More... | |
void | ast_logger_set_queue_limit (int queue_limit) |
Set the maximum number of messages allowed in the processing queue. More... | |
void | ast_logger_unregister_level (const char *name) |
Unregister a previously registered logger level. More... | |
void | ast_queue_log (const char *queuename, const char *callid, const char *agent, const char *event, const char *fmt,...) |
ast_callid | ast_read_threadstorage_callid (void) |
extracts the callerid from the thread More... | |
int | ast_register_verbose (void(*verboser)(const char *string)) attribute_warn_unused_result |
unsigned int | ast_trace_get_by_module (const char *module) |
Get the trace level for a module. More... | |
int | ast_unregister_verbose (void(*verboser)(const char *string)) attribute_warn_unused_result |
int | ast_verb_console_get (void) |
Get this thread's console verbosity level. More... | |
void | ast_verb_console_register (int *level) |
Register this thread's console verbosity level pointer. More... | |
void | ast_verb_console_set (int verb_level) |
Set this thread's console verbosity level. More... | |
void | ast_verb_console_unregister (void) |
Unregister this thread's console verbosity level. | |
void | ast_verb_update (void) |
Re-evaluate the system max verbosity level (ast_verb_sys_level). | |
Variables | |
int | ast_verb_sys_level |
Support for logging to various files, console and syslog Configuration in file logger.conf.
Definition in file include/asterisk/logger.h.
#define ast_debug | ( | level, | |
... | |||
) |
Log a DEBUG message.
level | The minimum value of option_debug for this message to get logged |
Definition at line 457 of file include/asterisk/logger.h.
Referenced by __analog_handle_event(), __ast_answer(), __ast_channel_alloc_ap(), __ast_pbx_run(), __ast_play_and_record(), __ast_read(), __ast_sorcery_object_type_insert_wizard(), __find_callno(), _ast_device_state(), _pgsql_exec(), access_counter_file(), acf_faxopt_write(), aco_process_config(), action_bridge(), ademco_detect_format(), alarmreceiver_exec(), app_subscribe_bridge(), app_subscribe_channel(), app_subscribe_endpoint(), append_var_and_value_to_filter(), apply_negotiated_sdp_stream(), ast_add_hint(), ast_apply_ha(), ast_ari_asterisk_update_object(), ast_ari_channels_continue_in_dialplan(), ast_ari_websocket_events_event_websocket_attempted(), ast_ari_websocket_events_event_websocket_established(), ast_ari_websocket_session_read(), ast_audiohook_set_frame_feed_direction(), ast_audiohook_write_frame(), ast_autochan_destroy(), ast_autochan_new_channel(), ast_autochan_setup(), ast_autoservice_start(), ast_autoservice_stop(), ast_bridge_channel_establish_roles(), ast_bridge_channel_feature_digit(), ast_bridge_channel_kick(), ast_bridge_channel_leave_bridge_nolock(), ast_bridge_channel_restore_formats(), ast_bridge_depart(), ast_bridge_destroy(), ast_bridge_features_enable(), ast_bridge_interval_hook(), ast_bridge_remove(), ast_bridge_setup_after_goto(), ast_calendar_clear_events(), ast_carefulwrite(), ast_cdr_backend_suspend(), ast_cdr_backend_unsuspend(), ast_cdr_engine_term(), ast_cdr_fork(), ast_channel_add_bridge_role(), ast_channel_audiohook_count_by_source(), ast_channel_audiohook_count_by_source_running(), ast_channel_callid_set(), ast_channel_clear_bridge_roles(), ast_channel_destructor(), ast_channel_inherit_variables(), ast_channel_register(), ast_channel_remove_bridge_role(), ast_channel_request_stream_topology_change(), ast_channel_softhangup_withcause_locked(), ast_channel_start_silence_generator(), ast_channel_stop_silence_generator(), ast_channel_unregister(), ast_check_hangup(), ast_check_signature_bin(), ast_config_text_file_save2(), ast_connected_line_parse_data(), ast_context_add_include2(), ast_context_find_or_create(), ast_data_buffer_put(), ast_db_del(), ast_dial_run(), ast_dns_get_nameservers(), ast_dns_resolve_ipv6_and_ipv4(), ast_dns_resolver_add_record(), ast_dns_resolver_set_result(), ast_dnsmgr_release(), ast_do_pickup(), ast_dsp_busydetect(), ast_dsp_process(), ast_dsp_set_busy_pattern(), ast_find_ourip(), ast_format_cap_update_by_allow_disallow(), ast_get_encoded_char(), ast_get_enum(), ast_get_srv(), ast_get_txt(), ast_hangup(), ast_http_body_discard(), ast_http_create_response(), ast_http_get_contents(), ast_http_send(), ast_iax2_new(), ast_io_add(), ast_io_dump(), ast_io_wait(), ast_iostream_write(), ast_json_utf8_check_len(), ast_load_resource(), ast_logger_unregister_level(), ast_media_cache_retrieve(), ast_media_index_update_for_file(), ast_msg_has_destination(), ast_odbc_find_table(), ast_odbc_release_obj(), ast_ouraddrfor(), ast_parse_arg(), ast_pbx_h_exten_run(), ast_pickup_call(), ast_prod(), ast_realtime_is_mapping_defined(), ast_redirecting_parse_data(), ast_rtcp_interpret(), ast_rtp_codecs_payloads_set_m_type(), ast_rtp_codecs_payloads_unset(), ast_rtp_codecs_payloads_xover(), ast_rtp_dtmf_begin(), ast_rtp_instance_early_bridge(), ast_rtp_instance_early_bridge_make_compatible(), ast_rtp_instance_new(), ast_rtp_read(), ast_say_date_with_format_da(), ast_say_date_with_format_de(), ast_say_date_with_format_en(), ast_say_date_with_format_es(), ast_say_date_with_format_fr(), ast_say_date_with_format_gr(), ast_say_date_with_format_he(), ast_say_date_with_format_it(), ast_say_date_with_format_nl(), ast_say_date_with_format_pl(), ast_say_date_with_format_pt(), ast_say_date_with_format_th(), ast_say_date_with_format_vi(), ast_say_date_with_format_zh(), ast_say_enumeration_full_da(), ast_say_enumeration_full_de(), ast_say_enumeration_full_en(), ast_say_enumeration_full_is(), ast_say_number_full_da(), ast_say_number_full_de(), ast_say_number_full_en_GB(), ast_say_number_full_es(), ast_say_number_full_fr(), ast_say_number_full_gr(), ast_say_number_full_hu(), ast_say_number_full_is(), ast_say_number_full_it(), ast_say_number_full_nl(), ast_say_number_full_no(), ast_say_number_full_ru(), ast_say_number_full_se(), ast_say_number_full_zh(), ast_sched_add_variable(), ast_sched_del_nonrunning(), ast_sched_runq(), ast_sched_wait(), ast_sched_when(), ast_sdp_srtp_alloc(), ast_search_dns(), ast_search_dns_ex(), ast_senddigit_begin(), ast_sendtext_data(), ast_set_default_eid(), ast_set_read_format_path(), ast_set_write_format_path(), ast_sip_get_distributor_serializer(), ast_sip_transport_monitor_register_replace_key(), ast_sockaddr_pj_sockaddr_cmp(), ast_sockaddr_resolve_first_af(), ast_sockaddr_split_hostport(), ast_softhangup_nolock(), ast_sorcery_is_stale(), ast_sorcery_objectset_json_create(), ast_ssl_init(), ast_str_retrieve_variable(), ast_str_substitute_variables_full2(), ast_stream_rewind(), ast_streamfile(), ast_tcptls_client_create(), ast_tcptls_close_session_file(), ast_tcptls_server_start(), ast_tcptls_server_stop(), ast_translate(), ast_translator_best_choice(), ast_unreal_hangup(), ast_uuid_init(), ast_websocket_write(), ast_write_stream(), ast_writestream(), ast_xml_query(), ast_xml_query_with_namespaces(), attended_transfer_monitor_thread(), attended_transfer_properties_alloc(), attended_transfer_properties_shutdown(), atxfer_abort(), atxfer_complete(), atxfer_swap(), atxfer_threeway(), atxfer_transferer_hangup(), auto_unload_resource(), bridge_agent_hold_push(), bridge_base_init(), calc_metric(), callerid_feed(), callerid_feed_jp(), callerid_get_dtmf(), cdr_object_create_public_records(), cdr_object_finalize(), chan_pjsip_digit_end(), chan_pjsip_read_stream(), chan_pjsip_sendtext_data(), chan_pjsip_set_rtp_peer(), change_outgoing_sdp_stream_media_address(), change_priority_caller_on_queue(), channel_do_masquerade(), check_password(), check_srcaddr(), cleaned_basedn(), conf_change_state(), conf_send_event_to_participants(), conf_update_user_mute(), confbridge_handle_atxfer(), config_ldap(), config_text_file_load(), console_read(), control_silence_stop_now(), control_swap_channel_in_bridge(), coreshowchannelmap_add_connected_channels(), create_followme_number(), create_outgoing_sdp_stream(), create_vmaccount(), crypto_load(), dahdi_answer(), dahdi_setoption(), defer_incoming_sdp_stream(), destroy_conference_bridge(), device_state_cb(), dial_bridge_after_cb(), dial_exec_full(), dns_system_resolver_process_query(), do_register(), do_register_expire(), do_say(), do_state_change(), dtmf_store_framehook(), fax_detect_framehook(), fax_gateway_detect_t38(), fax_gateway_detect_v21(), fax_gateway_framehook(), fax_gateway_request_t38(), fax_session_new(), fax_session_reserve(), feature_attended_transfer(), feature_blind_transfer(), filter(), find_best_technology(), find_load_queue_rt_friendly(), find_queue_by_name_rt(), generic_fax_exec(), generic_http_callback(), get_input(), get_member_status(), getproviderstate(), graceful_unload_possible(), handle_attended_transfer(), handle_blind_transfer(), handle_channel_snapshot_update_message(), handle_cli_agi_add_cmd(), handle_getoption(), handle_jack_audio(), handle_output(), handle_response_brsf(), handle_response_ciev(), handle_response_cind(), handle_response_cmgr(), handle_response_cmti(), handle_response_error(), handle_response_ok(), handle_response_ring(), handle_sms_prompt(), hangup_cause2sip(), hfp_parse_ciev(), hfp_parse_cind_indicator(), hfp_parse_cind_test(), hfp_parse_clip(), hfp_parse_cmti(), hfp_parse_ecav(), iax2_devicestate(), iax2_lock_callno_unless_destroyed(), ilbctolin_framein(), indicate_data_internal(), init_convolve_channel_pair(), io_grow(), is_our_turn(), is_read_allowed(), is_write_allowed(), jingle_action_session_terminate(), jingle_queue_hangup_with_cause(), jingle_read(), join_conference_bridge(), last_message_index(), ldap_loadentry(), ldap_reconnect(), leave_queue(), leave_voicemail(), lintospeex_feedback(), load_config(), load_modules(), load_resource_list(), local_devicestate(), log_events(), lua_find_extension(), lua_pbx_exec(), make_email_file(), make_trunk(), manager_modulecheck(), manager_show_dialplan_helper(), matrix_rebuild(), mbl_load_adapter(), mbl_load_device(), message_template_parse_filebody(), messaging_app_subscribe_endpoint(), messaging_app_unsubscribe_endpoint(), minivm_accmess_exec(), modules_shutdown(), native_rtp_bridge_join(), negotiate_incoming_sdp_stream(), object_type_loaded_observer(), parking_notify_metermaids(), parse_config(), parse_dial_string(), parse_naptr(), pbx_extension_helper(), pbx_substitute_variables_helper_full_location(), peer_set_srcaddr(), pgsql_exec(), pri_queue_for_destruction(), process_events(), process_message(), prometheus_metric_register(), prometheus_metric_unregister(), queue_exec(), queue_set_param(), read_mf_digits(), read_sf_digits(), really_quit(), realtime_ldap_base_ap(), realtime_ldap_entry_to_var(), realtime_ldap_result_to_vars(), realtime_peer(), receive_ademco_event(), receive_dtmf_digits(), receivefax_exec(), reload_followme(), reload_queue_members(), request_withdraw_caller_from_queue(), rfcomm_write_full(), ring_one(), rqm_exec(), rtp_raw_write(), run_agi(), run_externnotify(), save_to_folder(), scan_service(), schedule_delivery(), sco_accept(), semicolon_count_var(), send_cluster_notify(), sendfax_exec(), set_config(), sig_pri_call(), sla_find_trunk_ref_byname(), sla_queue_event_conf(), softmix_bridge_destroy(), softmix_bridge_join(), sorcery_astdb_filter_objectset(), sorcery_realtime_filter_objectset(), sorcery_wizard_create(), sorcery_wizard_delete(), sorcery_wizard_update(), spandsp_fax_read(), stasis_app_control_add_channel_to_bridge(), stasis_app_control_answer(), stasis_app_control_play_uri(), stasis_app_control_record(), stasis_app_control_remove_channel_from_bridge(), stasis_app_device_state_update(), stasis_app_exec(), stasis_app_subscribe_channel(), stasis_message_type_declined(), stasis_state_remove_publish_by_id(), stasis_state_subscribe_pool(), stasis_topic_create_with_detail(), store_next_lin(), store_next_rr(), stream_monitor(), substituted(), t30_phase_e_handler(), t38_automatic_reject(), t38_change_state(), t38_framehook(), t38_initialize_session(), t38_reinvite_response_cb(), trace_cb(), transfer_target_framehook_cb(), transport_state_callback(), try_load_key(), unref_mansession(), update_qe_rule(), user_alloc(), user_dtor(), vm_change_password(), wait_for_answer(), websocket_echo_callback(), wizard_mapped_observer(), write_metadata(), xfer_client_on_evsub_state(), xml_translate(), xmpp_client_receive(), xmpp_client_reconnect(), xmpp_client_requested_tls(), xmpp_client_thread(), xmpp_component_service_discovery_get_hook(), xmpp_pak_message(), xmpp_ping_request(), and xmpp_pubsub_handle_event().
#define ast_log_dynamic_level | ( | level, | |
... | |||
) | ast_log(level, _A_, __VA_ARGS__) |
Send a log message to a dynamically registered log level.
level | The log level to send the message to |
Like ast_log, the log message may include printf-style formats, and the data for these must be provided as additional parameters after the log message.
Definition at line 444 of file include/asterisk/logger.h.
Referenced by ast_cc_agent_set_interfaces_chanvar(), ast_cc_call_init(), ast_cc_monitor_count(), ast_fax_log(), ast_handle_cc_control_frame(), ast_set_cc_interfaces_chanvar(), history_on_rx_msg(), and history_on_tx_msg().
#define ast_verb | ( | level, | |
... | |||
) |
Definition at line 468 of file include/asterisk/logger.h.
#define ast_verb_callid | ( | level, | |
callid, | |||
... | |||
) |
Definition at line 475 of file include/asterisk/logger.h.
#define DEBUG_ATLEAST | ( | level | ) |
Definition at line 446 of file include/asterisk/logger.h.
#define DEBUG_M | ( | a | ) |
Definition at line 38 of file include/asterisk/logger.h.
enum ast_logger_results |
Definition at line 57 of file include/asterisk/logger.h.
void __ast_verbose | ( | const char * | file, |
int | line, | ||
const char * | func, | ||
int | level, | ||
const char * | fmt, | ||
... | |||
) |
Send a verbose message (based on verbose level)
This works like ast_log, but prints verbose messages to the console depending on verbosity level set.
ast_verbose(VERBOSE_PREFIX_3 "Whatever %s is happening\n", "nothing");
This will print the message to the console if the verbose level is set to a level >= 3
Note the absence of a comma after the VERBOSE_PREFIX_3. This is important. VERBOSE_PREFIX_1 through VERBOSE_PREFIX_10 are defined.
Definition at line 2550 of file logger.c.
void __ast_verbose_callid | ( | const char * | file, |
int | line, | ||
const char * | func, | ||
int | level, | ||
ast_callid | callid, | ||
const char * | fmt, | ||
... | |||
) |
Send a verbose message (based on verbose level) with deliberately specified callid.
just like __ast_verbose, only __ast_verbose_callid allows you to specify which callid is being used for the log without needing to bind it to a thread. NULL is a valid argument for this function and will allow you to specify that a log will never display a call id even when there is a call id bound to the thread.
void ast_callid_strnprint | ( | char * | buffer, |
size_t | buffer_size, | ||
ast_callid | callid | ||
) |
copy a string representation of the callid into a target string
buffer | destination of callid string (should be able to store 13 characters or more) |
buffer_size | maximum writable length of the string (Less than 13 will result in truncation) |
callid | Callid for which string is being requested |
Definition at line 2288 of file logger.c.
Referenced by ast_channel_callid_set(), and handle_showchan().
int ast_callid_threadassoc_add | ( | ast_callid | callid | ) |
Adds a known callid to thread storage of the calling thread.
0 | - success |
non-zero | - failure |
Definition at line 2320 of file logger.c.
References ast_log(), and ast_threadstorage_get().
Referenced by __ast_pbx_run(), ast_callid_threadstorage_auto(), async_dial(), attended_transfer_monitor_thread(), bridge_channel_depart_thread(), bridge_channel_ind_thread(), jingle_action_hook(), and jingle_outgoing_hook().
int ast_callid_threadassoc_change | ( | ast_callid | callid | ) |
Sets what is stored in the thread storage to the given callid if it does not match what is already there.
0 | - success |
non-zero | - failure |
Definition at line 2307 of file logger.c.
References ast_threadstorage_get().
int ast_callid_threadassoc_remove | ( | void | ) |
Removes callid from thread storage of the calling thread.
0 | - success |
non-zero | - failure |
Definition at line 2339 of file logger.c.
References ast_threadstorage_get().
Referenced by ast_callid_threadstorage_auto_clean(), attended_transfer_monitor_thread(), jingle_action_hook(), and jingle_outgoing_hook().
int ast_callid_threadstorage_auto | ( | ast_callid * | callid | ) |
Checks thread storage for a callid and stores a reference if it exists. If not, then a new one will be created, bound to the thread, and a reference to it will be stored.
callid | pointer to store the callid |
0 | - callid was found |
1 | - callid was created |
-1 | - the function failed somehow (presumably memory problems) |
Definition at line 2356 of file logger.c.
References ast_callid_threadassoc_add(), ast_create_callid(), and ast_read_threadstorage_callid().
Referenced by __analog_handle_event().
void ast_callid_threadstorage_auto_clean | ( | ast_callid | callid, |
int | callid_created | ||
) |
Use in conjunction with ast_callid_threadstorage_auto. Cleans up the references and if the callid was created by threadstorage_auto, unbinds the callid from the threadstorage.
callid | The callid set by ast_callid_threadstorage_auto |
callid_created | The integer returned through ast_callid_threadstorage_auto |
Definition at line 2378 of file logger.c.
References ast_callid_threadassoc_remove().
Referenced by __analog_handle_event().
void ast_console_puts_mutable | ( | const char * | string, |
int | level | ||
) |
log the string to the console, and all attached console clients
string | The message to write to the console |
level | The log level of the message |
log the string to the console, and all attached console clients
Definition at line 1316 of file asterisk.c.
References ast_console_puts_mutable_full().
Referenced by init_logger_chain().
void ast_console_puts_mutable_full | ( | const char * | message, |
int | level, | ||
int | sublevel | ||
) |
log the string to the console, and all attached console clients
message | The message to write to the console |
sublevel | If the log level supports it, the sub-level of the message |
level | The log level of the message |
Definition at line 1323 of file asterisk.c.
References ast_network_puts_mutable().
Referenced by ast_console_puts_mutable(), and logger_print_normal().
void ast_console_toggle_loglevel | ( | int | fd, |
int | level, | ||
int | state | ||
) |
enables or disables logging of a specified level to the console fd specifies the index of the console receiving the level change level specifies the index of the logging level being toggled state indicates whether logging will be on or off (0 for off, 1 for on)
enables or disables logging of a specified level to the console fd specifies the index of the console receiving the level change level specifies the index of the logging level being toggled state indicates whether logging will be on or off (0 for off, 1 for on)
Definition at line 1251 of file asterisk.c.
References console::levels.
ast_callid ast_create_callid | ( | void | ) |
factory function to create a new uniquely identifying callid.
Definition at line 2293 of file logger.c.
References ast_atomic_fetchadd_int().
Referenced by __ast_pbx_run(), ast_callid_threadstorage_auto(), and jingle_alloc().
unsigned int ast_debug_get_by_module | ( | const char * | module | ) |
Get the debug level for a module.
module | the name of module |
Definition at line 136 of file main/cli.c.
References AST_LIST_TRAVERSE, AST_RWLIST_RDLOCK, and AST_RWLIST_UNLOCK.
int ast_is_logger_initialized | ( | void | ) |
static void ast_log | ( | int | level, |
const char * | file, | ||
int | line, | ||
const char * | function, | ||
const char * | fmt, | ||
... | |||
) |
Used for sending a log message This is the standard logger function. Probably the only way you will invoke it would be something like this: ast_log(AST_LOG_WHATEVER, "Problem with the %s Captain. We should get some more. Will %d be enough?\n", "flux capacitor", 10); where WHATEVER is one of ERROR, DEBUG, EVENT, NOTICE, or WARNING depending on which log you wish to output to. These are implemented as macros, that will provide the function with the needed arguments.
level | Type of log event |
file | Will be provided by the AST_LOG_* macro |
line | Will be provided by the AST_LOG_* macro |
function | Will be provided by the AST_LOG_* macro |
fmt | This is what is important. The format is the same as your favorite breed of printf. You know how that works, right? :-) |
Definition at line 130 of file ael_main.c.
Referenced by ast_callid_threadassoc_add(), ast_log_backtrace(), and init_logger().
void ast_log_callid | ( | int | level, |
const char * | file, | ||
int | line, | ||
const char * | function, | ||
ast_callid | callid, | ||
const char * | fmt, | ||
... | |||
) |
Used for sending a log message with a known call_id This is a modified logger function which is functionally identical to the above logger function, it just include a call_id argument as well. If NULL is specified here, no attempt will be made to join the log message with a call_id.
level | Type of log event |
file | Will be provided by the AST_LOG_* macro |
line | Will be provided by the AST_LOG_* macro |
function | Will be provided by the AST_LOG_* macro |
callid | This is the ast_callid that is associated with the log message. May be NULL. |
fmt | This is what is important. The format is the same as your favorite breed of printf. You know how that works, right? :-) |
Definition at line 2501 of file logger.c.
References ast_log_full().
Referenced by ast_channel_destructor().
void ast_log_safe | ( | int | level, |
const char * | file, | ||
int | line, | ||
const char * | function, | ||
const char * | fmt, | ||
... | |||
) |
Used for sending a log message with protection against recursion.
Definition at line 2475 of file logger.c.
References ast_log_full(), ast_read_threadstorage_callid(), ast_threadstorage_get_ptr(), and ast_threadstorage_set_ptr().
Referenced by __ast_str_helper(), and ast_log_backtrace().
int ast_logger_create_channel | ( | const char * | log_channel, |
const char * | components | ||
) |
Create a log channel.
log_channel | Log channel to create |
components | Logging config levels to add to the log channel |
Definition at line 1521 of file logger.c.
References AST_LOGGER_ALLOC_ERROR, AST_LOGGER_DECLINE, AST_LOGGER_FAILURE, AST_LOGGER_SUCCESS, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, find_logchannel(), logchannel::list, and logchannel::logmask.
Referenced by ast_ari_asterisk_add_log().
int ast_logger_get_channels | ( | int(*)(const char *channel, const char *type, const char *status, const char *configuration, void *data) | logentry, |
void * | data | ||
) |
Retrieve the existing log channels.
logentry | A callback to an updater function |
data | Data passed into the callback for manipulation |
For each of the logging channels, logentry will be executed with the channel file name, log type, status of the log, and configuration levels.
0 | on success |
1 | on failure |
-2 | on allocation error |
Definition at line 1409 of file logger.c.
References AST_LOGGER_ALLOC_ERROR, AST_LOGGER_FAILURE, AST_LOGGER_SUCCESS, AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, ast_str_append(), ast_str_buffer(), ast_str_create, ast_str_reset(), logchannel::disabled, logchannel::filename, logchannel::list, logchannel::logmask, and logchannel::type.
Referenced by ast_ari_asterisk_list_log_channels().
const char* ast_logger_get_dateformat | ( | void | ) |
int ast_logger_get_dynamic_level | ( | const char * | name | ) |
Retrieve dynamic logging level id.
name | The name of the level |
-1 | if level name not found |
Definition at line 2880 of file logger.c.
References AST_RWLIST_RDLOCK, and AST_RWLIST_UNLOCK.
int ast_logger_get_queue_limit | ( | void | ) |
int ast_logger_register_level | ( | const char * | name | ) |
Register a new logger level.
name | The name of the level to be registered |
-1 | if an error occurs |
non-zero | level to be used with ast_log for sending messages to this level |
Definition at line 2851 of file logger.c.
References AST_RWLIST_UNLOCK, and AST_RWLIST_WRLOCK.
Referenced by load_module().
int ast_logger_remove_channel | ( | const char * | log_channel | ) |
Delete the specified log channel.
log_channel | The log channel to delete |
Definition at line 1587 of file logger.c.
References AST_LOGGER_FAILURE, AST_LOGGER_SUCCESS, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, logchannel::dynamic, logchannel::fileptr, find_logchannel(), and logchannel::list.
Referenced by ast_ari_asterisk_delete_log().
int ast_logger_rotate_channel | ( | const char * | log_channel | ) |
Rotate the specified log channel.
log_channel | The log channel to rotate |
Definition at line 1332 of file logger.c.
References AST_LOGGER_FAILURE, AST_LOGGER_SUCCESS, ast_mkdir(), AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, logchannel::disabled, logchannel::filename, logchannel::fileptr, init_logger_chain(), logchannel::list, make_filename(), and manager_event.
Referenced by ast_ari_asterisk_rotate_log().
void ast_logger_set_queue_limit | ( | int | queue_limit | ) |
void ast_logger_unregister_level | ( | const char * | name | ) |
Unregister a previously registered logger level.
name | The name of the level to be unregistered |
Definition at line 2909 of file logger.c.
References ast_debug, AST_RWLIST_UNLOCK, and AST_RWLIST_WRLOCK.
Referenced by unload_module().
ast_callid ast_read_threadstorage_callid | ( | void | ) |
extracts the callerid from the thread
Non-zero | Call id related to the thread |
0 | if no call_id is present in the thread |
Definition at line 2298 of file logger.c.
References ast_threadstorage_get().
Referenced by __ast_pbx_run(), __ast_verbose(), ast_callid_threadstorage_auto(), ast_dial_run(), ast_log_safe(), jingle_alloc(), and local_request_with_stream_topology().
int ast_verb_console_get | ( | void | ) |
Get this thread's console verbosity level.
Definition at line 2673 of file logger.c.
References AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, ast_threadstorage_get(), verb_console::level, and option_verbose.
Referenced by handle_show_settings().
void ast_verb_console_register | ( | int * | level | ) |
Register this thread's console verbosity level pointer.
level | Where the verbose level value is. |
Definition at line 2646 of file logger.c.
References AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_threadstorage_get(), ast_verb_update(), and verb_console::level.
void ast_verb_console_set | ( | int | verb_level | ) |
Set this thread's console verbosity level.
verb_level | New level to set. |
Definition at line 2691 of file logger.c.
References AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_threadstorage_get(), ast_verb_update(), verb_console::level, and option_verbose.