24 #include "thermferm.h" |
24 #include "thermferm.h" |
25 #include "futil.h" |
25 #include "futil.h" |
26 #include "xutil.h" |
26 #include "xutil.h" |
27 |
27 |
28 |
28 |
29 void initlog(char *unit) |
29 void initlog(char *code, char *name) |
30 { |
30 { |
31 char buf[128], *filename; |
31 char buf[128], *filename; |
32 |
32 |
33 snprintf(buf, 127, "Mode,Air,Beer,Target_L,S_Heater,S_Cooler,S_Fan,S_Door,U_Heater,U_Cooler,U_Fan,Room,Target_H,Chiller"); |
33 snprintf(buf, 127, "Mode,Air,Beer,Target_L,S_Heater,S_Cooler,S_Fan,S_Door,U_Heater,U_Cooler,U_Fan,Room,Target_H,Chiller"); |
34 filename = xstrcpy(unit); |
34 filename = xstrcpy(code); |
|
35 filename = xstrcat(filename, (char *)" "); |
|
36 filename = xstrcat(filename, name); |
35 filename = xstrcat(filename, (char *)".log"); |
37 filename = xstrcat(filename, (char *)".log"); |
36 logger(filename, buf); |
38 logger(filename, buf); |
37 free(filename); |
39 free(filename); |
38 filename = NULL; |
40 filename = NULL; |
39 } |
41 } |