journal simplifying (before systematic usage)

This commit is contained in:
Jean Sirmai 2024-09-19 23:21:00 +02:00
parent dc4820fe17
commit 6061e78958
Signed by: jean
GPG Key ID: FB3115C340E057E3
5 changed files with 27 additions and 38 deletions

View File

@ -55,7 +55,7 @@ enum severity {CRITICAL, ERROR, WARNING, INFO, MESSAGE, DEBUG, SPEW};
//
// CRITICAL ERROR WARNING INFO MESSAGE DEBUG SPEW (see: fsm.h)
// 0 1 2 3 4 5 6 (fsm_journal_event)
/*
#define CRITICAL 0 // THE HIGHER THE PRIORITY, THE LOWER THE INDEX
#define ERROR 1
#define WARNING 2
@ -63,7 +63,7 @@ enum severity {CRITICAL, ERROR, WARNING, INFO, MESSAGE, DEBUG, SPEW};
#define INFO 4
#define DEBUG 5
#define SPEW 6 // THE_LOWER THE PRIORITY, THE HIGHER THE INDEX
*/
/* * * * * * * - F I L T E R S - * * * * * * *
* This list is duplicated in both /fsm.h and /fsm/dispatch *
* *
@ -93,10 +93,11 @@ enum severity {CRITICAL, ERROR, WARNING, INFO, MESSAGE, DEBUG, SPEW};
* FSM 90
* *
* This list is duplicated in both /fsm.h and /fsm/dispatch *
* * * * * * * - F I L T E R S - * * * * * * */
* * * * * * * * * * * * * * * * * * * * */
/* * * * * - M E T A R U L E S J O U R N A L - * * * *
/* * * * * - J O U R N A L M E T A R U L E S - * * * *
*
* Un seul fsm_journal_event() par fonction
* sauf si elle génère plusieurs autres fonctions d'intérêt (à surveiller)
@ -104,7 +105,7 @@ enum severity {CRITICAL, ERROR, WARNING, INFO, MESSAGE, DEBUG, SPEW};
* S'il y a deux fsm_journal_event() (begin / end) dans une fonction
* ils doivent avoir la même étiquette : MESSAGE, SOURCE, TARGET
*
* * * * * - M E T A R U L E S J O U R N A L - * * * */
* * * * * - J O U R N A L M E T A R U L E S - * * * */
enum source {

View File

@ -66,7 +66,7 @@ void fsm_journal_event (char *message, int priority, int source, int target)
// CRITICAL ERROR WARNING INFO MESSAGE DEBUG SPEW 😄️
// 0 1 2 3 4 5 6
if (priority == 0 //<= DEBUG
if (priority < 6
#define MAIN___DIALOG___MODAL___TOPBAR___SYNTH___RULES___MEASURES___RESULTS___😄 0
/* * * * * * * - S O U R C E - * * * * * * *
@ -94,30 +94,20 @@ void fsm_journal_event (char *message, int priority, int source, int target)
* This list is duplicated in both /fsm.h and /fsm/dispatch *
* * * * * * * - S O U R C E - * * * * * * */
|| source == 16
&& source == 0
/* * * * * * * - T A R G E T - * * * * * * *
* This list is duplicated in both /fsm.h and /fsm/dispatch *
*
* ANY 0
* WIDGET
* BUTTON
* SCROLL
* GLAREA
* TEXT
* LABEL
* TREE
* EXPANDER
* TOPBAR
*
* AUTO_NOTIFICATION 80
*
* FSM 90
* ANY WIDGET BUTTON SCROLL GLAREA TEXT LABEL TREE
* EXPANDER TOPBAR
* AUTO_NOTIFICATION
* FSM
* *
* This list is duplicated in both /fsm.h and /fsm/dispatch *
* * * * * * * - T A R G E T - * * * * * * */
|| target == 41)
&& target == 0)
fsm_journal_push (message);
}
@ -132,21 +122,21 @@ void fsm_init (char *initial_message_from_main)
fsm_journal_init (&gg_logs);
fsm_journal_event (initial_message_from_main, MESSAGE, SOURCE, TARGET);
fsm_journal_event ("fsm/dispatch initialisation fsm has began", MESSAGE, SOURCE, TARGET);
fsm_journal_event ("fsm/dispatch fsm initialisation has began", MESSAGE, SOURCE, TARGET);
fsm_measures_list_init();
fsm_journal_event ("fsm/dispatch measures list init()", MESSAGE, SOURCE, TARGET);
fsm_measures_list_init();
fsm_results_list_init();
fsm_journal_event ("fsm/dispatch results list init()", MESSAGE, SOURCE, TARGET);
fsm_results_list_init();
fsm_displayable_list_init();
fsm_journal_event ("fsm/dispatch displayable list init()", MESSAGE, SOURCE, TARGET);
fsm_displayable_list_init();
fsm_preferences_list_init();
fsm_journal_event ("fsm/dispatch preferences list init()", MESSAGE, SOURCE, TARGET);
fsm_preferences_list_init();
fsm_journal_event ("fsm/dispatch initialisation fsm has ended", MESSAGE, SOURCE, TARGET);
fsm_journal_event ("fsm/dispatch fsm initialisation has ended", MESSAGE, SOURCE, TARGET);
}
@ -163,8 +153,8 @@ void fsm_set_preferences_modified (bool value)
char str2[20]; sprintf(str2, " (%d)\n", value); strcat(str1, str2);
fsm_journal_event (str1, INFO, SOURCE, TARGET);
fsm_journal_event ("fsm/dispatch preferences modified value = ?\n\
> Je ne sais ni concatener les strings ni utiliser 'itoa'", INFO, SOURCE, TARGET);
fsm_journal_event ("fsm/dispatch preferences modified value = ?",
INFO, SOURCE, TARGET);
preferences_have_been_modified = value;
/*
if (value) fsm_journal_event (

View File

@ -136,11 +136,11 @@ void fsm_add_displayable (char *displayable_name)
/******************************************************************************/
void fsm_preferences_list_init ()
{
fsm_journal_event ("fsm/prefer preferences list required()", MESSAGE, SOURCE, TARGET);
fsm_journal_event ("fsm/prefer setting up preferences list", MESSAGE, SOURCE, TARGET);
}
void fsm_displayable_list_init ()
{
fsm_journal_event ("fsm/prefer displayable list required()", MESSAGE, SOURCE, TARGET);
fsm_journal_event ("fsm/prefer setting up displayable list", MESSAGE, SOURCE, TARGET);
}

View File

@ -274,8 +274,8 @@ void on_toggle_exec_edit (GtkWidget *toggled_button, gpointer user_data)
static void switch_state_rules_data()
{
fsm_journal_event ("signal switch state rules data() has began",
INFO, SOURCE, TARGET);
fsm_journal_event ("signal switch state rules data()",
DEBUG, SOURCE, TARGET);
switch (fsm_get_state_rules_data()) {
case (SYNTH) :
@ -322,8 +322,6 @@ static void switch_state_rules_data()
fsm_journal_event ("signal default in : switch state rules data()",
INFO, SOURCE, TARGET);
}
fsm_journal_event ("signal switch state rules data() has ended",
INFO, SOURCE, TARGET);
}
// TODO Il doit y avoir plus élégant,... ET SURTOUT MOINS DANGEREUX !!!