OpenSync  0.22
Enumerations | Functions

Debug functions used by opensync. More...

Enumerations

enum  OSyncTraceType {
  TRACE_ENTRY, TRACE_EXIT, TRACE_INTERNAL, TRACE_SENSITIVE,
  TRACE_EXIT_ERROR, TRACE_ERROR
}
 The type of the trace. More...
 

Functions

void osync_trace_reset_indent (void)
 
void osync_trace (OSyncTraceType type, const char *message,...)
 Used for tracing the application. More...
 
void osync_debug (const char *subpart, int level, const char *message,...)
 Used for debugging. More...
 
char * osync_print_binary (const unsigned char *data, int len)
 Used for printing binary data. More...
 
char * osync_rand_str (int maxlength)
 Creates a random string. More...
 

Detailed Description

Debug functions used by opensync.

Enumeration Type Documentation

The type of the trace.

Enumerator
TRACE_ENTRY 

Used when entering a function. This will indent the callgraph

TRACE_EXIT 

Used when exiting a function. This will unindent the callgraph

TRACE_INTERNAL 

Used for traces inside a function. Does not indent.

TRACE_SENSITIVE 

Used for traces with sensitive content inside a function. Does not indent.

TRACE_EXIT_ERROR 

Used when exiting a function with a error. This will unindent the callgraph

Definition at line 6 of file opensync_debug.h.

Function Documentation

void osync_trace_reset_indent ( void  )

This function will reset the indentation of the trace function. use this after you forked your process. the new process should call this function

Definition at line 35 of file opensync_debug.c.

void osync_trace ( OSyncTraceType  type,
const char *  message,
  ... 
)

Used for tracing the application.

use this function to trace calls. The call graph will be saved into the file that is given in the OSYNC_TRACE environment variable

Parameters
typeThe type of the trace
messageThe message to save

Definition at line 51 of file opensync_debug.c.

Referenced by _new_change_receiver(), get_next_vertice_neighbour(), osengine_finalize(), osengine_free(), osengine_init(), osengine_mapping_check_timestamps(), osengine_mapping_duplicate(), osengine_mapping_ignore_conflict(), osengine_mapping_ignore_supported(), osengine_mapping_solve(), osengine_mapping_solve_latest(), osengine_mapping_solve_updated(), osengine_new(), osengine_reset(), osengine_sync_and_block(), osengine_synchronize(), osync_change_compare(), osync_change_compare_data(), osync_change_convert_extension(), osync_change_convert_to_common(), osync_change_copy(), osync_change_copy_data(), osync_change_detect_objformat(), osync_change_detect_objformat_full(), osync_change_free(), osync_change_get_objformat(), osync_change_get_revision(), osync_change_new(), osync_change_reset(), osync_change_set_objformat_string(), osync_change_set_objtype_string(), osync_change_update(), osync_conv_env_new(), osync_conv_find_extension(), osync_debug(), osync_env_finalize(), osync_env_initialize(), osync_env_load_formats(), osync_env_load_plugins(), osync_env_plugin_is_usable(), osync_filter_add(), osync_filter_add_custom(), osync_filter_free(), osync_filter_get_config(), osync_filter_new(), osync_filter_register(), osync_filter_remove(), osync_filter_set_config(), osync_group_get_slow_sync(), osync_group_load(), osync_group_lock(), osync_group_reset_slow_sync(), osync_group_save(), osync_group_set_last_synchronization(), osync_group_set_slow_sync(), osync_hashtable_detect_change(), osync_hashtable_get_changetype(), osync_hashtable_get_deleted(), osync_hashtable_report(), osync_hashtable_report_deleted(), osync_hashtable_update_hash(), osync_member_add_random_data(), osync_member_commit_change(), osync_member_committed_all(), osync_member_connect(), osync_member_delete_data(), osync_member_disconnect(), osync_member_finalize(), osync_member_get_change_data(), osync_member_get_changeinfo(), osync_member_get_config(), osync_member_get_config_or_default(), osync_member_get_loop(), osync_member_get_slow_sync(), osync_member_has_configuration(), osync_member_initialize(), osync_member_load(), osync_member_make_random_data(), osync_member_modify_random_data(), osync_member_read_change(), osync_member_request_synchronization(), osync_member_save(), osync_member_set_config(), osync_member_set_configdir(), osync_member_set_loop(), osync_member_set_objtype_enabled(), osync_member_sync_done(), osync_message_set_handler(), osync_module_load(), osync_module_load_dir(), osync_module_unload(), osync_plugin_free(), osync_plugin_new_info(), osync_queue_get_message(), osync_queue_new(), osync_queue_set_message_handler(), osync_queue_setup_with_gmainloop(), osync_try_malloc0(), and osync_user_new().

void osync_debug ( const char *  subpart,
int  level,
const char *  message,
  ... 
)
char* osync_print_binary ( const unsigned char *  data,
int  len 
)

Used for printing binary data.

Unprintable character will be printed in hex, printable are just printed

Parameters
dataThe data to print
lenThe length to print

Definition at line 220 of file opensync_debug.c.

char* osync_rand_str ( int  maxlength)

Creates a random string.

Creates a random string of given length or less

Parameters
maxlengthThe maximum length of the string
Returns
The random string

Definition at line 241 of file opensync_debug.c.