Heraia  0.1.8
log.c File Reference

Includes everything that deals with the logging system. More...

#include <libheraia.h>
Include dependency graph for log.c:

Go to the source code of this file.

Functions

static void my_log (heraia_struct_t *main_struct, gchar *log_domain, GLogLevelFlags log_level, const char *format,...)
 A function that allow me to printy things on stdout and in th log window. More...
 
static void log_window_connect_signals (heraia_struct_t *main_struct)
 Connecting the window signals to the right functions. More...
 
static gboolean delete_log_window_event (GtkWidget *widget, GdkEvent *event, gpointer data)
 Closing the window. More...
 
static void destroy_log_window (GtkWidget *widget, GdkEvent *event, gpointer data)
 When the window is destroyed (Gtk's doc says that we may never get there) More...
 
static void logw_close_clicked (GtkWidget *widget, gpointer data)
 Close button is clicked. More...
 
static void scroll_down_textview (heraia_struct_t *main_struct)
 Scrolling down to the new line at the end of the textview. More...
 
void print_message (const char *format,...)
 Prints a message to stdout. More...
 
void log_message (heraia_struct_t *main_struct, GLogLevelFlags log_level, const char *format,...)
 A function that helps logging a message a the specified level. More...
 
void mw_cmi_show_logw_toggle (GtkWidget *widget, gpointer data)
 The Check menu item for the Log window. More...
 
void log_window_init_interface (heraia_struct_t *main_struct)
 Inits the log window interface Called once at init time. More...
 

Detailed Description

Includes everything that deals with the logging system.

Definition in file log.c.

Function Documentation

static gboolean delete_log_window_event ( GtkWidget *  widget,
GdkEvent *  event,
gpointer  data 
)
static

Closing the window.

Parameters
widget: calling widget
event: event associated (may be NULL as we don't use this here)
data: MUST be heraia_struct_t *main_struct main structure and not NULL
Returns
Always returns TRUE in order to propagate the signal

Definition at line 297 of file log.c.

References logw_close_clicked().

Referenced by log_window_connect_signals().

Here is the call graph for this function:

Here is the caller graph for this function:

static void destroy_log_window ( GtkWidget *  widget,
GdkEvent *  event,
gpointer  data 
)
static

When the window is destroyed (Gtk's doc says that we may never get there)

Parameters
widget: calling widget
event: event associated (may be NULL as we don't use this here)
data: MUST be heraia_struct_t *main_struct main structure and not NULL

Definition at line 312 of file log.c.

References logw_close_clicked().

Referenced by log_window_connect_signals().

Here is the call graph for this function:

Here is the caller graph for this function:

void log_message ( heraia_struct_t main_struct,
GLogLevelFlags  log_level,
const char *  format,
  ... 
)

A function that helps logging a message a the specified level.

A wrapper to my_log function log_domain is defined by HERAIA_LOG_DOMAIN

Parameters
main_struct: main structure
log_level: A string that may be either G_LOG_FLAG_RECURSION, G_LOG_FLAG_FATAL, G_LOG_LEVEL_ERROR, G_LOG_LEVEL_CRITICAL, G_LOG_LEVEL_WARNING, G_LOG_LEVEL_MESSAGE, G_LOG_LEVEL_INFO, G_LOG_LEVEL_DEBUG
format: a printf style format
...: va_list to fill the format.
Todo:
may be include the hability to choose a different log domain ?

Definition at line 195 of file log.c.

References heraia_struct_t::debug, HERAIA_LOG_DOMAIN, and my_log().

Referenced by fdft_prev_next_bt_clicked(), fdft_search_direction(), get_plugin_handle(), get_plugin_init_symbol(), init(), init_heraia_plugin_system(), init_plugin(), init_plugin_name_tv(), load_file_to_analyse(), load_mp_file_preferences_options(), load_one_plugin(), load_plugins(), load_preferences(), main(), on_close_activate(), on_new_activate(), on_projects_open_activate(), on_save_activate(), on_save_as_activate(), on_tests_menu_activate(), realize_some_numerical_stat(), rw_add_one_tab_from_find_all_bt(), rw_on_notebook_switch_page(), rw_remove_all_tabs(), set_notebook_tab_label_color(), and tree_selection_changed().

Here is the call graph for this function:

Here is the caller graph for this function:

static void log_window_connect_signals ( heraia_struct_t main_struct)
static

Connecting the window signals to the right functions.

Parameters
main_struct: main structure

Definition at line 346 of file log.c.

References delete_log_window_event(), destroy_log_window(), heraia_get_widget(), logw_close_clicked(), xml_t::main, mw_cmi_show_logw_toggle(), and heraia_struct_t::xmls.

Referenced by log_window_init_interface().

Here is the call graph for this function:

Here is the caller graph for this function:

void log_window_init_interface ( heraia_struct_t main_struct)

Inits the log window interface Called once at init time.

Parameters
main_struct: main structure

Definition at line 376 of file log.c.

References heraia_get_widget(), log_window_connect_signals(), xml_t::main, and heraia_struct_t::xmls.

Referenced by load_heraia_ui().

Here is the call graph for this function:

Here is the caller graph for this function:

static void logw_close_clicked ( GtkWidget *  widget,
gpointer  data 
)
static

Close button is clicked.

Parameters
widget: calling widget
data: MUST be heraia_struct_t *main_struct main structure and not NULL

Definition at line 324 of file log.c.

References heraia_get_widget(), all_window_prop_t::log_box, xml_t::main, record_and_hide_dialog_box(), heraia_struct_t::win_prop, and heraia_struct_t::xmls.

Referenced by delete_log_window_event(), destroy_log_window(), and log_window_connect_signals().

Here is the call graph for this function:

Here is the caller graph for this function:

void mw_cmi_show_logw_toggle ( GtkWidget *  widget,
gpointer  data 
)

The Check menu item for the Log window.

Parameters
widget: the widget that issued the signal (here the log check menu item
data: user data, MUST be main_struct main structure

Definition at line 263 of file log.c.

References heraia_get_widget(), all_window_prop_t::log_box, xml_t::main, move_and_show_dialog_box(), record_and_hide_dialog_box(), scroll_down_textview(), heraia_struct_t::win_prop, and heraia_struct_t::xmls.

Referenced by log_window_connect_signals().

Here is the call graph for this function:

Here is the caller graph for this function:

static void my_log ( heraia_struct_t main_struct,
gchar *  log_domain,
GLogLevelFlags  log_level,
const char *  format,
  ... 
)
static

A function that allow me to printy things on stdout and in th log window.

Parameters
main_struct: main structure
log_domain: should be the program's name
log_level: A string that may be either G_LOG_FLAG_RECURSION, G_LOG_FLAG_FATAL, G_LOG_LEVEL_ERROR, G_LOG_LEVEL_CRITICAL, G_LOG_LEVEL_WARNING, G_LOG_LEVEL_MESSAGE, G_LOG_LEVEL_INFO, G_LOG_LEVEL_DEBUG
format: a printf style format
...: va_list to fill the format.

Definition at line 87 of file log.c.

References heraia_get_widget(), xml_t::main, scroll_down_textview(), and heraia_struct_t::xmls.

Referenced by log_message().

Here is the call graph for this function:

Here is the caller graph for this function:

void print_message ( const char *  format,
  ... 
)

Prints a message to stdout.

Parameters
format: a printf style format
...: va_list to fill the format.

Definition at line 44 of file log.c.

static void scroll_down_textview ( heraia_struct_t main_struct)
static

Scrolling down to the new line at the end of the textview.

Parameters
main_struct: main structure

Definition at line 164 of file log.c.

References heraia_get_widget(), xml_t::main, and heraia_struct_t::xmls.

Referenced by mw_cmi_show_logw_toggle(), and my_log().

Here is the call graph for this function:

Here is the caller graph for this function: