Send Linux-ha-cvs mailing list submissions to linux-ha-cvs@lists.linux-ha.org
To subscribe or unsubscribe via the World Wide Web, visit http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs or, via email, send a message with subject or body 'help' to [EMAIL PROTECTED] You can reach the person managing the list at [EMAIL PROTECTED] When replying, please edit your Subject line so it is more specific than "Re: Contents of Linux-ha-cvs digest..." Today's Topics: 1. Linux-HA CVS: include by andrew from (linux-ha-cvs@lists.linux-ha.org) 2. Linux-HA CVS: lib by andrew from (linux-ha-cvs@lists.linux-ha.org) 3. Linux-HA CVS: lib by andrew from (linux-ha-cvs@lists.linux-ha.org) ---------------------------------------------------------------------- Message: 1 Date: Sun, 23 Apr 2006 13:50:20 -0600 (MDT) From: linux-ha-cvs@lists.linux-ha.org Subject: [Linux-ha-cvs] Linux-HA CVS: include by andrew from To: [EMAIL PROTECTED] Message-ID: <[EMAIL PROTECTED]> linux-ha CVS committal Author : andrew Host : Project : linux-ha Module : include Dir : linux-ha/include/crm Modified Files: transition.h Log Message: TE Logging improvements =================================================================== RCS file: /home/cvs/linux-ha/linux-ha/include/crm/transition.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- transition.h 20 Feb 2006 16:21:52 -0000 1.5 +++ transition.h 23 Apr 2006 19:50:19 -0000 1.6 @@ -1,4 +1,4 @@ -/* $Id: transition.h,v 1.5 2006/02/20 16:21:52 andrew Exp $ */ +/* $Id: transition.h,v 1.6 2006/04/23 19:50:19 andrew Exp $ */ /* * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]> * @@ -135,7 +135,7 @@ extern void destroy_graph(crm_graph_t *graph); extern const char *transition_status(enum transition_status state); extern void print_graph(unsigned int log_level, crm_graph_t *graph); -extern void print_graph_action( +extern void print_action( int log_level, const char *prefix, crm_action_t *action); extern void update_abort_priority( crm_graph_t *graph, int priority, ------------------------------ Message: 2 Date: Sun, 23 Apr 2006 13:50:20 -0600 (MDT) From: linux-ha-cvs@lists.linux-ha.org Subject: [Linux-ha-cvs] Linux-HA CVS: lib by andrew from To: [EMAIL PROTECTED] Message-ID: <[EMAIL PROTECTED]> linux-ha CVS committal Author : andrew Host : Project : linux-ha Module : lib Dir : linux-ha/lib/crm/transition Modified Files: utils.c Log Message: TE Logging improvements =================================================================== RCS file: /home/cvs/linux-ha/linux-ha/lib/crm/transition/utils.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- utils.c 3 Apr 2006 10:42:05 -0000 1.7 +++ utils.c 23 Apr 2006 19:50:19 -0000 1.8 @@ -1,4 +1,4 @@ -/* $Id: utils.c,v 1.7 2006/04/03 10:42:05 andrew Exp $ */ +/* $Id: utils.c,v 1.8 2006/04/23 19:50:19 andrew Exp $ */ /* * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]> * @@ -104,78 +104,81 @@ } static void -print_input(const char *prefix, crm_action_t *input, int log_level) +print_elem(int log_level, const char *prefix, gboolean as_input, crm_action_t *action) { - const char *task_uuid = crm_element_value( - input->xml, XML_LRM_ATTR_TASK_KEY); - crm_log_maybe(log_level, - "%s[Input %d] %s (id: %s, type: %s, priority=%d)", - prefix, input->id, - input->confirmed?"Satisfied":"Pending", - task_uuid, - actiontype2text(input->type), - input->synapse->priority); + const char *key = NULL; + const char *host = NULL; + const char *class = "Action"; + const char *state = "Pending"; - if(input->confirmed == FALSE) { - crm_log_xml(log_level+2, "\t\t\tRaw input: ", input->xml); - } -} + if(action->failed) { + state = "Failed"; + } else if(action->confirmed) { + state = "Completed"; -void -print_graph_action(int log_level, const char *prefix, crm_action_t *action) -{ - crm_log_maybe(log_level, "%s[Action %d] %s%s", - prefix, action->id, - action->confirmed?"Completed": - action->executed?"In-flight": - action->sent_update?"Update sent":"Pending", - action->can_fail?" (can fail)":""); - + } else if(action->executed) { + state = "In-flight"; + + } else if(action->sent_update) { + state = "Update sent"; + } + + if(as_input) { + class = "Input"; + } + + key = crm_element_value(action->xml, XML_LRM_ATTR_TASK_KEY); + host = crm_element_value(action->xml, XML_LRM_ATTR_TARGET); + switch(action->type) { case action_type_pseudo: - crm_log_maybe(log_level, "%s\tPseudo Op: %s", prefix, - crm_element_value( - action->xml, XML_LRM_ATTR_TASK_KEY)); + crm_log_maybe(log_level, + "%s[%s %d]: %s (id: %s, type: %s, priority: %d)", + prefix, class, action->id, state, key, + actiontype2text(action->type), + action->synapse->priority); break; case action_type_rsc: - crm_log_maybe(log_level, "%s\tResource Op: %s/%s on %s", - prefix, - crm_element_value( - action->xml, XML_LRM_ATTR_RSCID), - crm_element_value( - action->xml, XML_LRM_ATTR_TASK), - crm_element_value( - action->xml, XML_LRM_ATTR_TARGET) -/* crm_element_value( */ -/* action->xml, XML_LRM_ATTR_TARGET_UUID) */ - ); - break; + crm_log_maybe(log_level, + "%s[%s %d]: %s (id: %s, loc: %s, priority: %d)", + prefix, class, action->id, state, key, host, + action->synapse->priority); case action_type_crm: - crm_log_maybe(log_level, "%s\tCRM Op: %s on %s (%s)", - prefix, - crm_element_value( - action->xml, XML_LRM_ATTR_TASK), - crm_element_value( - action->xml, XML_LRM_ATTR_TARGET), - crm_element_value( - action->xml, XML_LRM_ATTR_TARGET_UUID)); + crm_log_maybe(log_level, + "%s[%s %d]: %s (id: %s, loc: %s, type: %s, priority: %d)", + prefix, class, action->id, state, key, host, + actiontype2text(action->type), + action->synapse->priority); break; + default: + crm_err("%s[%s %d]: %s (id: %s, loc: %s, type: %s (unhandled), priority: %d)", + prefix, class, action->id, state, key, host, + actiontype2text(action->type), + action->synapse->priority); } - if(action->timeout > 0) { - do_crm_log(log_level, __FILE__, __FUNCTION__, - "%s\ttimeout=%d, timer=%d", prefix, - action->timeout, - action->timer?action->timer->source_id:0); + if(as_input == FALSE) { + return; + } + + if(action->timer) { + crm_log_maybe(log_level, "%s\ttimeout=%d, timer=%d", prefix, + action->timeout, action->timer->source_id); } if(action->confirmed == FALSE) { - crm_log_xml(log_level+2, "\t\t\tRaw action: ", action->xml); + crm_log_xml(log_level+2, "\t\t\tRaw xml: ", action->xml); } } void +print_action(int log_level, const char *prefix, crm_action_t *action) +{ + print_elem(log_level, prefix, FALSE, action); +} + +void print_graph(unsigned int log_level, crm_graph_t *graph) { if(graph == NULL || graph->num_actions == 0) { @@ -198,13 +201,13 @@ if(synapse->confirmed == FALSE) { slist_iter( action, crm_action_t, synapse->actions, lpc2, - print_graph_action(log_level, "\t", action); + print_elem(log_level, " ", FALSE, action); ); } if(synapse->executed == FALSE) { slist_iter( input, crm_action_t, synapse->inputs, lpc2, - print_input("\t", input, log_level); + print_elem(log_level, " * ", TRUE, input); ); } ------------------------------ Message: 3 Date: Sun, 23 Apr 2006 13:55:54 -0600 (MDT) From: linux-ha-cvs@lists.linux-ha.org Subject: [Linux-ha-cvs] Linux-HA CVS: lib by andrew from To: [EMAIL PROTECTED] Message-ID: <[EMAIL PROTECTED]> linux-ha CVS committal Author : andrew Host : Project : linux-ha Module : lib Dir : linux-ha/lib/crm/transition Modified Files: graph.c Log Message: More logging we dont need to see =================================================================== RCS file: /home/cvs/linux-ha/linux-ha/lib/crm/transition/graph.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- graph.c 21 Apr 2006 07:08:04 -0000 1.10 +++ graph.c 23 Apr 2006 19:55:54 -0000 1.11 @@ -1,4 +1,4 @@ -/* $Id: graph.c,v 1.10 2006/04/21 07:08:04 andrew Exp $ */ +/* $Id: graph.c,v 1.11 2006/04/23 19:55:54 andrew Exp $ */ /* * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]> * @@ -186,12 +186,12 @@ CRM_CHECK(task != NULL, return FALSE); if(safe_str_eq(task, CRM_OP_FENCE)) { - crm_info("Executing STONITH-event: %d", + crm_debug_2("Executing STONITH-event: %d", action->id); return graph_fns->stonith(graph, action); } - crm_info("Executing crm-event: %d", action->id); + crm_debug_2("Executing crm-event: %d", action->id); return graph_fns->crmd(graph, action); } ------------------------------ _______________________________________________ Linux-ha-cvs mailing list Linux-ha-cvs@lists.linux-ha.org http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs End of Linux-ha-cvs Digest, Vol 29, Issue 121 *********************************************