PROFILE PUT command logging added.

Tue, 02 Sep 2014 15:07:34 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Tue, 02 Sep 2014 15:07:34 +0200
changeset 279
4c505414435c
parent 278
76c8a6f18e4d
child 280
de3dc781ba65

PROFILE PUT command logging added.

thermferm/server.c file | annotate | diff | comparison | revisions
--- a/thermferm/server.c	Tue Sep 02 15:02:33 2014 +0200
+++ b/thermferm/server.c	Tue Sep 02 15:07:34 2014 +0200
@@ -871,12 +871,18 @@
 			val = strtok(NULL, "\0");
 			if (kwd && val) {
 			    if (strcmp(kwd, (char *)"NAME") == 0) {
-				if (profile->name)
+				if (profile->name) {
+				    if (strcmp(profile->name, val))
+					syslog(LOG_NOTICE, "Profile %s name `%s' to `%s'", profile->uuid, profile->name, val);
 				    free(profile->name);
+				}
 				profile->name = xstrcpy(val);
 			    } else if (strcmp(kwd, (char *)"INITTEMP") == 0) {
-				if (sscanf(val, "%f", &fval) == 1)
+				if (sscanf(val, "%f", &fval) == 1) {
+				    if (profile->inittemp != fval)
+					syslog(LOG_NOTICE, "Profile %s initial temperature %.1f to %.1f", profile->uuid, profile->inittemp, fval);
 				    profile->inittemp = fval;
+				}
 			    }
 			}
 		    }

mercurial