22 # define __CCL_LOG_H__
215 # define CCL_DEBUG_START_TIMED_BLOCK(_args) \
216 CCL_DEBUG_COND_START_TIMED_BLOCK (ccl_debug_is_on, _args)
218 # define CCL_DEBUG_END_TIMED_BLOCK() \
219 CCL_DEBUG_COND_END_TIMED_BLOCK (ccl_debug_is_on)
221 # define CCL_DEBUG_COND_START_TIMED_BLOCK(_cond,_args) \
222 do { if (_cond) ccl_debug_start_timed_block _args ; } while (0)
224 # define CCL_DEBUG_COND_END_TIMED_BLOCK(_cond) \
225 do { if (_cond) ccl_debug_end_timed_block () ; } while (0)
238 ccl_log_redirect_to_FILE (
ccl_log_type type, FILE *output);
void ccl_log(ccl_log_type type, const char *fmt,...)
Sends the message formatted using the specification fmt on the stream indicated by type...
void ccl_log_add_listener(ccl_log_proc *proc, void *data)
Adds a message listener.
Vital informations displayed before an urgent exit.
void ccl_log_va(ccl_log_type type, const char *fmt, va_list pa)
Behaves like ccl_log but the variable arguments are replaced by a va_list.
Log type freely available for user.
void ccl_debug_start_timed_block(const char *fmt,...)
Starts a timed block of statements.
void ccl_debug_push_tab_level(void)
Increments the level of the CCL_LOG_DEBUG stream.
void ccl_display(const char *fmt,...)
Behaves like ccl_log but the message is send on CCL_LOG_DISPLAY.
void ccl_log_push_redirection(ccl_log_type type, ccl_log_proc *proc, void *data)
Redirects the data sent to the stream type to the listener proc.
void ccl_warning(const char *fmt,...)
Behaves like ccl_log but the message is send on CCL_LOG_WARNING.
void ccl_log_redirect_to_string(ccl_log_type type, char **dst)
Redirects messages sent to 'type' stream into the string 'dst'.
void ccl_log_proc(ccl_log_type type, const char *msg, void *data)
Prototype of callback functions receiving messages.
ccl_log_type_enum
Enum that indicates which kind of message has to be displayed. Each kind of message can be displayed ...
Some useful and common macros.
Log type freely available for user.
void ccl_panic(const char *fmt,...)
Behaves like ccl_log but the message is send on CCL_LOG_PANIC.
void ccl_debug_end_timed_block(void)
Ends a timed block of statements.
enum ccl_log_type_enum ccl_log_type
Enum that indicates which kind of message has to be displayed. Each kind of message can be displayed ...
void ccl_debug_pop_tab_level(void)
Decrements the level of the CCL_LOG_DEBUG stream.
void ccl_error(const char *fmt,...)
Behaves like ccl_log but the message is send on CCL_LOG_ERROR.
void ccl_log_pop_redirection(ccl_log_type type)
Removes redirection for the stream type.
void ccl_debug_max_level(int maxlevel)
Indicates maximal level after which nothing else is displayed. If the current level is >= maxlevel th...
void ccl_log_remove_listener(ccl_log_proc *proc)
Removes the listener proc.
int ccl_debug_is_on
Boolean variable indicating if debugging traces are actived or not.
int ccl_log_has_listener(void)
Checks if a listener of messages is yet positioned.
void ccl_debug(const char *fmt,...)
Behaves like ccl_log but the message is send on CCL_LOG_DEBUG.