Hi Andrew,

Thanks for your quick reply.

I remade the patch by the means to add to existing logic.
(attachment : update_log1.patch)

If it is possible, i want to get also the attribute names of XML("name", 
"value") for log analysis.
So, update_log2.patch is better for me.
I would like to hear your any opinion.

Regards,
Yoshihiko SATO

(2011/07/05 12:09), Andrew Beekhof wrote:
On Tue, Jul 5, 2011 at 12:36 PM, Yoshihiko SATO
<satoyo...@intellilink.co.jp>  wrote:
Hi Andrew,

Thank you for advice.


In this case I'd just append " $name=$value"

Sorry, I don't understand..
Your meaning is checking the attribute name and value that are null or not?

I mean to the log message.
If its TYPE(reason) == nvpair, then add " %s=%s" to the string to
display the name and value.

                do_crm_log(log_level,
                           "%s:%d - Triggered transition abort (complete=%d, 
tag=%s, id=%s,
magic=%s) : %s",
                           fn, line, transition_graph->complete, TYPE(reason), 
ID(reason),
magic?magic:"NA", abort_text);


Makes sense?

(Weird being in the same timezone :-)



Regards,
Yoshihiko SATO

(2011/07/05 10:39), Andrew Beekhof wrote:

On Mon, Jul 4, 2011 at 8:05 PM, Yoshihiko SATO
<satoyo...@intellilink.co.jp>    wrote:

Hi Andrew,

Thanks for your comment.

Do you mean that the output logic is branched by some conditions?

Right

If my understanding is correct, What conditions should we judge?
"tag"(TYPE(reason)), "abort_text" or otherwise?

  - TYPE(reason) == "nvpair"
       Is it all right judging as attribute update?

Correct

  - abort_text == "Transient attribute: update"
       I am concerned about changing contents of strings.

In this case I'd just append " $name=$value"

_______________________________________________
Pacemaker mailing list: Pacemaker@oss.clusterlabs.org
http://oss.clusterlabs.org/mailman/listinfo/pacemaker

Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs:
http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker



_______________________________________________
Pacemaker mailing list: Pacemaker@oss.clusterlabs.org
http://oss.clusterlabs.org/mailman/listinfo/pacemaker

Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs:
http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker


_______________________________________________
Pacemaker mailing list: Pacemaker@oss.clusterlabs.org
http://oss.clusterlabs.org/mailman/listinfo/pacemaker

Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker


diff -r c86cb93c5a57 crmd/te_utils.c
--- a/crmd/te_utils.c	Tue May 31 16:37:56 2011 +0800
+++ b/crmd/te_utils.c	Tue Jul 05 13:53:36 2011 +0900
@@ -352,9 +352,10 @@
 		    &diff_add_admin_epoch, &diff_add_epoch, &diff_add_updates, 
 		    &diff_del_admin_epoch, &diff_del_epoch, &diff_del_updates);
 		do_crm_log(log_level,
-			   "%s:%d - Triggered transition abort (complete=%d, tag=%s, id=%s, magic=%s, cib=%d.%d.%d) : %s",
+			   "%s:%d - Triggered transition abort (complete=%d, tag=%s, id=%s, magic=%s, cib=%d.%d.%d) : %s %s",
 			   fn, line, transition_graph->complete, TYPE(reason), ID(reason), magic?magic:"NA",
-			   diff_add_admin_epoch,diff_add_epoch,diff_add_updates, abort_text);
+			   diff_add_admin_epoch,diff_add_epoch,diff_add_updates, abort_text, 
+			   crm_str_eq(TYPE(reason), XML_CIB_TAG_NVPAIR , TRUE)?crm_concat(NAME(reason), VALUE(reason), '='):"");
 		
 	    } else {
 		do_crm_log(log_level,
diff -r c86cb93c5a57 include/crm/msg_xml.h
--- a/include/crm/msg_xml.h	Tue May 31 16:37:56 2011 +0800
+++ b/include/crm/msg_xml.h	Tue Jul 05 13:53:36 2011 +0900
@@ -294,5 +294,7 @@
 #define INSTANCE(x) crm_element_value(x, XML_CIB_ATTR_INSTANCE)
 #define TSTAMP(x) crm_element_value(x, XML_ATTR_TSTAMP)
 #define TYPE(x) crm_element_name(x) 
+#define NAME(x) crm_element_value(x, XML_NVPAIR_ATTR_NAME)
+#define VALUE(x) crm_element_value(x, XML_NVPAIR_ATTR_VALUE)
 
 #endif
diff -r c86cb93c5a57 crmd/te_utils.c
--- a/crmd/te_utils.c	Tue May 31 16:37:56 2011 +0800
+++ b/crmd/te_utils.c	Tue Jul 05 13:56:26 2011 +0900
@@ -351,10 +351,17 @@
 		    diff,
 		    &diff_add_admin_epoch, &diff_add_epoch, &diff_add_updates, 
 		    &diff_del_admin_epoch, &diff_del_epoch, &diff_del_updates);
-		do_crm_log(log_level,
-			   "%s:%d - Triggered transition abort (complete=%d, tag=%s, id=%s, magic=%s, cib=%d.%d.%d) : %s",
-			   fn, line, transition_graph->complete, TYPE(reason), ID(reason), magic?magic:"NA",
-			   diff_add_admin_epoch,diff_add_epoch,diff_add_updates, abort_text);
+		if(crm_str_eq(TYPE(reason), XML_CIB_TAG_NVPAIR , TRUE)) {
+		    do_crm_log(log_level,
+		        "%s:%d - Triggered transition abort (complete=%d, tag=%s, id=%s, name=%s, value=%s, magic=%s, cib=%d.%d.%d) : %s",
+		        fn, line, transition_graph->complete, TYPE(reason), ID(reason), NAME(reason), VALUE(reason), magic?magic:"NA",
+		        diff_add_admin_epoch,diff_add_epoch,diff_add_updates, abort_text);
+		} else {
+		    do_crm_log(log_level,
+		        "%s:%d - Triggered transition abort (complete=%d, tag=%s, id=%s, magic=%s, cib=%d.%d.%d) : %s",
+		        fn, line, transition_graph->complete, TYPE(reason), ID(reason), magic?magic:"NA",
+		        diff_add_admin_epoch,diff_add_epoch,diff_add_updates, abort_text);
+		}
 		
 	    } else {
 		do_crm_log(log_level,
diff -r c86cb93c5a57 include/crm/msg_xml.h
--- a/include/crm/msg_xml.h	Tue May 31 16:37:56 2011 +0800
+++ b/include/crm/msg_xml.h	Tue Jul 05 13:56:26 2011 +0900
@@ -294,5 +294,7 @@
 #define INSTANCE(x) crm_element_value(x, XML_CIB_ATTR_INSTANCE)
 #define TSTAMP(x) crm_element_value(x, XML_ATTR_TSTAMP)
 #define TYPE(x) crm_element_name(x) 
+#define NAME(x) crm_element_value(x, XML_NVPAIR_ATTR_NAME)
+#define VALUE(x) crm_element_value(x, XML_NVPAIR_ATTR_VALUE)
 
 #endif
_______________________________________________
Pacemaker mailing list: Pacemaker@oss.clusterlabs.org
http://oss.clusterlabs.org/mailman/listinfo/pacemaker

Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker

Reply via email to