thermferm/rdconfig.c

changeset 235
885ad8d52126
parent 217
2922d439ff63
child 240
6bdda35b4a13
--- a/thermferm/rdconfig.c	Wed Aug 13 21:21:55 2014 +0200
+++ b/thermferm/rdconfig.c	Wed Aug 13 21:41:10 2014 +0200
@@ -137,7 +137,7 @@
      * Create a new XML buffer, to which the XML document will be written
      */
     if ((buf = xmlBufferCreate()) == NULL) {
-	syslog(LOG_NOTICE, "wrconfig: error creating the xml buffer");
+	syslog(LOG_WARNING, "wrconfig: error creating the xml buffer");
 	return 1;
     }
 
@@ -145,7 +145,7 @@
      * Create a new XmlWriter for memory, with no compression.
      */
     if ((writer = xmlNewTextWriterMemory(buf, 0)) == NULL) {
-	syslog(LOG_NOTICE, "wrconfig: error creating the xml writer");
+	syslog(LOG_WARNING, "wrconfig: error creating the xml writer");
 	return 1;
     }
 
@@ -153,7 +153,7 @@
      * Use indentation instead of one long line
      */
     if ((rc = xmlTextWriterSetIndent(writer, 2)) < 0) {
-	syslog(LOG_NOTICE, "wrconfig: error setting Indent");
+	syslog(LOG_WARNING, "wrconfig: error setting Indent");
 	return 1;
     }
 
@@ -163,7 +163,7 @@
      * declaration. 
      */
     if ((rc = xmlTextWriterStartDocument(writer, NULL, MY_ENCODING, NULL)) < 0) {
-	syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterStartDocument");
+	syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterStartDocument");
 	return 1;
     }
 
@@ -172,7 +172,7 @@
      * element, this will be the root element of the document.
      */
     if ((rc = xmlTextWriterStartElement(writer, BAD_CAST "THERMFERM")) < 0) {
-	syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterStartElement");
+	syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterStartElement");
 	return 1;
     }
 
@@ -180,39 +180,39 @@
      * Add an attribute with name "VERSION" and value "1" to THERMFERM. 
      */
     if ((rc = xmlTextWriterWriteElement(writer, BAD_CAST "VERSION", BAD_CAST "1")) < 0) {
-	syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement");
+	syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement");
 	return 1;
     }
     if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "LISTEN_PORT", "%d", Config.my_port)) < 0) {
-	syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+	syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 	return 1;
     }
     if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "TEMPFORMAT", "%c", Config.tempFormat)) < 0) {
-	syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+	syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 	return 1;
     }
     if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "TEMP_ADDRESS", "%s", Config.temp_address)) < 0) {
-	syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+	syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 	return 1;
     }
     if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "TEMP_STATE", "%d", Config.temp_state)) < 0) {
-	syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+	syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 	return 1;                           
     }
     if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "TEMP_VALUE", "%d", Config.temp_value)) < 0) {
-	syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+	syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 	return 1;
     }
     if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "HUM_ADDRESS", "%s", Config.hum_address)) < 0) {
-	syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+	syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 	return 1;
     }   
     if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "HUM_STATE", "%d", Config.hum_state)) < 0) {
-	syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+	syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 	return 1;    
     }   
     if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "HUM_VALUE", "%d", Config.hum_value)) < 0) {
-	syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+	syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 	return 1;
     }
 
@@ -221,7 +221,7 @@
      * Start an element named "LCDS" as child of THERMFERM.
      */
     if ((rc = xmlTextWriterStartElement(writer, BAD_CAST "LCDS")) < 0) {
-	syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterStartElement");
+	syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterStartElement");
 	return 1;
     }
     /*
@@ -229,37 +229,37 @@
      * However this program doesn't use more then one yet.
      */
     if ((rc = xmlTextWriterStartElement(writer, BAD_CAST "LCD")) < 0) {
-	syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterStartElement");
+	syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterStartElement");
 	return 1;
     }
     if ((rc = xmlTextWriterWriteElement(writer, BAD_CAST "VERSION", BAD_CAST "1")) < 0) {
-	syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement");
+	syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement");
 	return 1;
     }
     if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "ADDRESS", "0x%x", Config.lcd_address)) < 0) {
-	syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+	syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 	return 1;
     }
     if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "COLUMNS", "%d", Config.lcd_cols)) < 0) {
-	syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+	syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 	return 1;
     }
     if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "ROWS", "%d", Config.lcd_rows)) < 0) {
-	syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+	syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 	return 1;
     }
     /* 
      * Close the element named LCD.
      */
     if ((rc = xmlTextWriterEndElement(writer)) < 0) {
-	syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterEndElement");
+	syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterEndElement");
 	return 1;
     }
     /*
      * Close the element LCDS.
      */
     if ((rc = xmlTextWriterEndElement(writer)) < 0) {
-	syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterEndElement");
+	syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterEndElement");
 	return 1;
     }
 #endif
@@ -269,7 +269,7 @@
      */
     if (Config.units) {
 	if ((rc = xmlTextWriterStartElement(writer, BAD_CAST "FERMENTERS")) < 0) {
-	    syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterStartElement");
+	    syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterStartElement");
 	    return 1;
 	}
 	for (tmp3 = Config.units; tmp3; tmp3 = tmp3->next) {
@@ -278,146 +278,146 @@
 	     * are written to a state file.
 	     */
 	    if ((rc = xmlTextWriterStartElement(writer, BAD_CAST "UNIT")) < 0) {
-		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterStartElement");
+		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterStartElement");
 		return 1;
 	    }
 	    if ((rc = xmlTextWriterWriteElement(writer, BAD_CAST "VERSION", BAD_CAST "1")) < 0) {
-		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement");
+		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement");
 		return 1;
 	    }
 	    if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "UUID", "%s", tmp3->uuid)) < 0) {
-		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		return 1;
 	    }
 	    if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "NAME", "%s", tmp3->name)) < 0) {
-		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		return 1;
 	    }
 	    if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "VOLUME", "%.1f", tmp3->volume)) < 0) {
-		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		return 1;
 	    }
 	    if (tmp3->air_address) {
 	    	if (((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "AIR_ADDRESS", "%s", tmp3->air_address)) < 0)) {
-		    syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		    syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		    return 1;
 	    	}
 		if (((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "AIR_STATE", "%d", tmp3->air_state)) < 0)) {
-		    syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		    syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		    return 1;
 		}
 		if (((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "AIR_TEMPERATURE", "%d", tmp3->air_temperature)) < 0)) {
-		    syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		    syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		    return 1;
 		}
 	    }
 	    if (tmp3->beer_address) {
 	    	if (((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "BEER_ADDRESS", "%s", tmp3->beer_address)) < 0)) {
-		    syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		    syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		    return 1;
 	    	}
 		if (((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "BEER_STATE", "%d", tmp3->beer_state)) < 0)) {
-		    syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		    syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		    return 1;
 		}
 		if (((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "BEER_TEMPERATURE", "%d", tmp3->beer_temperature)) < 0)) {
-		    syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		    syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		    return 1;
 		}
 	    }
 	    if (tmp3->heater_address) {
 		if (((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "HEATER_ADDRESS", "%s", tmp3->heater_address)) < 0)) {
-		    syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		    syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		    return 1;
 		}
 		if (((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "HEATER_STATE", "%d", tmp3->heater_state)) < 0)) {
-		    syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		    syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		    return 1;
 		}
 	    }
 	    if (tmp3->cooler_address) {
 		if (((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "COOLER_ADDRESS", "%s", tmp3->cooler_address)) < 0)) {
-		    syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		    syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		    return 1;
 		}
 		if (((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "COOLER_STATE", "%d", tmp3->cooler_state)) < 0)) {
-		    syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		    syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		    return 1;                                   
 		}
 	    }
 	    if (tmp3->fan_address) {
 		if (((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "FAN_ADDRESS", "%s", tmp3->fan_address)) < 0)) {
-		    syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		    syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		    return 1;
 		}
 		if (((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "FAN_STATE", "%d", tmp3->fan_state)) < 0)) {
-		    syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		    syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		    return 1;                                   
 		}
 	    }
 	    if (tmp3->door_address) {
 		if (((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "DOOR_ADDRESS", "%s", tmp3->door_address)) < 0)) {
-		    syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		    syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		return 1;
 		}
 		if (((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "DOOR_STATE", "%d", tmp3->door_state)) < 0)) {
-		    syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		    syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		return 1;
 		}
 	    }
 	    if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "MODE", "%s", UNITMODE[tmp3->mode] )) < 0) {
-		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		return 1;
 	    }
 	    if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "BEER_SET", "%.1f", tmp3->beer_set)) < 0) {
-		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		return 1;
 	    }
 	    if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "FRIDGE_SET", "%.1f", tmp3->fridge_set)) < 0) {
-		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		return 1;
 	    }
 	    if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "TEMP_SET_MIN", "%.1f", tmp3->temp_set_min)) < 0) {
-		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		return 1;
 	    }
 	    if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "TEMP_SET_MAX", "%.1f", tmp3->temp_set_max)) < 0) {
-		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		return 1;
 	    }
 	    if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "IDLE_RANGE_L", "%.1f", tmp3->idle_rangeL)) < 0) {
-		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		return 1;
 	    }
 	    if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "IDLE_RANGE_H", "%.1f", tmp3->idle_rangeH)) < 0) {
-		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		return 1;
 	    }
 	    if (tmp3->profile) {
 		if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "PROFILE", "%s", tmp3->profile)) < 0) {
-		    syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		    syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		    return 1;
 		}
 		if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "PROF_STARTED", "%d", (unsigned int)tmp3->prof_started)) < 0) {
-		    syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		    syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		    return 1;
 		}
 		if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "PROF_PAUSED", "%d", (unsigned int)tmp3->prof_paused)) < 0) {
-		    syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		    syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		    return 1;
 		}
 		if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "PROF_STATE", "%s", PROFSTATE[tmp3->prof_state] )) < 0) {
-		    syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		    syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		    return 1;
 		}
 	    }
 	    if ((rc = xmlTextWriterEndElement(writer)) < 0) {
-		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterEndElement");
+		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterEndElement");
 		return 1;
 	    }
 	}
 	if ((rc = xmlTextWriterEndElement(writer)) < 0) {
-	    syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterEndElement");
+	    syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterEndElement");
 	    return 1;
 	}
     }
@@ -427,155 +427,155 @@
      */
     if (Config.profiles) {
 	if ((rc = xmlTextWriterStartElement(writer, BAD_CAST "PROFILES")) < 0) {
-	    syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterStartElement");
+	    syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterStartElement");
 	    return 1;
 	}
 	for (tmp4 = Config.profiles; tmp4; tmp4 = tmp4->next) {
 	    if ((rc = xmlTextWriterStartElement(writer, BAD_CAST "PROFILE")) < 0) {
-		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterStartElement");
+		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterStartElement");
 		return 1;
 	    }
 	    if ((rc = xmlTextWriterWriteElement(writer, BAD_CAST "VERSION", BAD_CAST "1")) < 0) {
-		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement");
+		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement");
 		return 1;
 	    }
 	    if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "UUID", "%s", tmp4->uuid)) < 0) {
-		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		return 1;
 	    }
 	    if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "NAME", "%s", tmp4->name)) < 0) {
-		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		return 1;
 	    }
 	    if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "BUSY", "%d", tmp4->busy)) < 0) {
-		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		return 1;
 	    }
 	    if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "INITTEMP", "%.1f", tmp4->inittemp)) < 0) {
-		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		return 1;
 	    }
 	    if (tmp4->steps) {
 		if ((rc = xmlTextWriterStartElement(writer, BAD_CAST "STEPS")) < 0) {
-		    syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterStartElement");
+		    syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterStartElement");
 		    return 1;
 		}
 		for (tmp5 = tmp4->steps; tmp5; tmp5 = tmp5->next) {
 		    if ((rc = xmlTextWriterStartElement(writer, BAD_CAST "STEP")) < 0) {
-			syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterStartElement");
+			syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterStartElement");
 			return 1;
 		    }
 		    if ((rc = xmlTextWriterWriteElement(writer, BAD_CAST "VERSION", BAD_CAST "1")) < 0) {
-			syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement");
+			syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement");
 			return 1;
 		    }
 		    if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "RESTTIME", "%d", tmp5->resttime)) < 0) {
-		        syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		        syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 			return 1;
 		    }
 		    if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "STEPTIME", "%d", tmp5->steptime)) < 0) {
-			syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+			syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 			return 1;
 		    }
 		    if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "TARGET", "%.1f", tmp5->target)) < 0) {
-		        syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		        syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 			return 1;
 		    }
 		    if ((rc = xmlTextWriterEndElement(writer)) < 0) {
-			syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterEndElement");
+			syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterEndElement");
 			return 1;
 		    }
 		}
 		if ((rc = xmlTextWriterEndElement(writer)) < 0) {
-		    syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterEndElement");
+		    syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterEndElement");
 		    return 1;
 		}
 	    }
 	    if ((rc = xmlTextWriterEndElement(writer)) < 0) {
-		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterEndElement");
+		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterEndElement");
 		return 1;
 	    }
 	}
 	if ((rc = xmlTextWriterEndElement(writer)) < 0) {
-	    syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterEndElement");
+	    syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterEndElement");
 	    return 1;
 	}
     }
 
     if (Config.devices) {
 	if ((rc = xmlTextWriterStartElement(writer, BAD_CAST "DEVICES")) < 0) {
-	    syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterStartElement");
+	    syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterStartElement");
 	    return 1;
 	}
 	for (device = Config.devices; device; device = device->next) {
 	    if ((rc = xmlTextWriterStartElement(writer, BAD_CAST "DEVICE")) < 0) {
-		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterStartElement");
+		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterStartElement");
 		return 1;
 	    }
 	    if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "VERSION", "%d", device->version)) < 0) {
-		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement");
+		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement");
 		return 1;
 	    }
 	    if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "UUID", "%s", device->uuid)) < 0) {
-		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		return 1;
 	    }
 	    if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "TYPE", "%s", DEVTYPE[device->type])) < 0) {
-		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		return 1;
 	    }
 	    if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "DIRECTION", "%s", DEVDIR[device->direction])) < 0) {
-		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		return 1;
 	    }
 	    if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "VALUE", "%d", device->value)) < 0) {
-		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement");
+		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement");
 		return 1;
 	    }
 	    if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "OFFSET", "%d", device->offset)) < 0) {
-		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement");
+		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement");
 		return 1;
 	    }
 	    if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "PRESENT", "%s", DEVPRESENT[device->present])) < 0) {
-		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteFormatElement");
+		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteFormatElement");
 		return 1;                           
 	    }
 	    if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "ADDRESS", "%s", device->address)) < 0) {
-		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement");
+		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement");
 		return 1;                           
 	    }
 	    if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "SUBDEVICE", "%d", device->subdevice)) < 0) {
-		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement");
+		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement");
 		return 1;                           
 	    }
 	    if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "GPIOPIN", "%d", device->gpiopin)) < 0) {
-		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement");
+		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement");
 		return 1;                           
 	    }
 	    if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "DESCRIPTION", "%s", device->description)) < 0) {
-		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement");
+		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement");
 		return 1;                           
 	    }
 	    if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "INUSE", "%d", device->inuse)) < 0) {
-		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement");
+		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement");
 		return 1;                           
 	    }
 	    if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "COMMENT", "%s", device->comment)) < 0) {
-		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement");
+		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement");
 		return 1;                           
 	    }
 	    if ((rc = xmlTextWriterWriteFormatElement(writer, BAD_CAST "TIMESTAMP", "%d", (int)device->timestamp)) < 0) {
-		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterWriteElement");
+		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterWriteElement");
 		return 1;                           
 	    }
 	    if ((rc = xmlTextWriterEndElement(writer)) < 0) {
-		syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterEndElement");
+		syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterEndElement");
 		return 1;
 	    }
 	}
 
 	if ((rc = xmlTextWriterEndElement(writer)) < 0) {
-	    syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterEndElement");
+	    syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterEndElement");
 	    return 1;
 	}
     }
@@ -584,7 +584,7 @@
      * All done, close any open elements
      */
     if ((rc = xmlTextWriterEndDocument(writer)) < 0) {
-	syslog(LOG_NOTICE, "wrconfig: error at xmlTextWriterEndDocument");
+	syslog(LOG_WARNING, "wrconfig: error at xmlTextWriterEndDocument");
 	return 1;
     }
     xmlFreeTextWriter(writer);
@@ -605,7 +605,7 @@
 	fprintf(stdout, "Writing %s\n", mypath);
 
     if ((fp = fopen(mypath, "w")) == NULL) {
-	syslog(LOG_NOTICE, "could not rewrite %s", mypath);
+	syslog(LOG_WARNING, "could not rewrite %s", mypath);
 	return 1;
     }
 
@@ -623,7 +623,7 @@
     int		rc;
 
     rc = do_wrconfig();
-    syslog(LOG_NOTICE, "Rewritten configuration, rc=%d", rc);
+    syslog(LOG_WARNING, "Rewritten configuration, rc=%d", rc);
     return rc;
 }
 
@@ -1175,7 +1175,7 @@
     xmlChar	*key;
 
     killconfig();
-    syslog(LOG_NOTICE, "HOME='%s' USER='%s' LOGNAME='%s'", MBSE_SS(getenv((char *)"HOME")), MBSE_SS(getenv((char *)"USER")), MBSE_SS(getenv((char *)"LOGNAME")));
+    syslog(LOG_WARNING, "HOME='%s' USER='%s' LOGNAME='%s'", MBSE_SS(getenv((char *)"HOME")), MBSE_SS(getenv((char *)"USER")), MBSE_SS(getenv((char *)"LOGNAME")));
 
     /*
      * Search config file
@@ -1201,20 +1201,20 @@
 	    free(mypath);
 	    mypath = xstrcpy((char *)"/usr/local/etc/mbsepi-apps/thermferm.xml");
 	    if ((doc = xmlParseFile(mypath)) == NULL) {
-		syslog(LOG_NOTICE, "rdconfig: could not find thermferm.xml");
+		syslog(LOG_WARNING, "rdconfig: could not find thermferm.xml");
 		return 1;
 	    }
 	}
     }
-    syslog(LOG_NOTICE, "rdconfig: using %s", mypath);
+    syslog(LOG_WARNING, "rdconfig: using %s", mypath);
 
     if ((cur = xmlDocGetRootElement(doc)) == NULL) {
-	syslog(LOG_NOTICE, "XML file %s empty.", mypath);
+	syslog(LOG_WARNING, "XML file %s empty.", mypath);
 	xmlFreeDoc(doc);
 	return 1;
     }
     if (xmlStrcmp(cur->name, (const xmlChar*)"THERMFERM")) {
-	syslog(LOG_NOTICE, "XML file %s is not a valid configuration file.", mypath);
+	syslog(LOG_WARNING, "XML file %s is not a valid configuration file.", mypath);
 	xmlFreeDoc(doc);
 	return 1;
     }
@@ -1228,7 +1228,7 @@
 	    key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
 	    if (xmlStrcmp(key, (const xmlChar *)"1")) {
 		xmlFree(key);
-		syslog(LOG_NOTICE, "XML file %s is not a valid version", mypath);
+		syslog(LOG_WARNING, "XML file %s is not a valid version", mypath);
 		return 1;
 	    }
 	    xmlFree(key);

mercurial