89 { DAV_PROPS_NS, "xattributes" }, |
89 { DAV_PROPS_NS, "xattributes" }, |
90 { DAV_PROPS_NS, "link" } |
90 { DAV_PROPS_NS, "link" } |
91 }; |
91 }; |
92 static size_t numdefprops = 8 ; |
92 static size_t numdefprops = 8 ; |
93 |
93 |
94 void log_printf(const char *loglevel, const char *fmt, ...) { |
94 void log_printf(const char *fmt, ...) { |
95 const char *sp = " "; |
|
96 if(!loglevel) { |
|
97 loglevel = ""; |
|
98 sp = ""; |
|
99 } |
|
100 |
|
101 va_list ap; |
95 va_list ap; |
102 va_start(ap, fmt); |
96 va_start(ap, fmt); |
103 cxmutstr str = cx_vasprintf(fmt, ap); |
97 cxmutstr str = cx_vasprintf(fmt, ap); |
|
98 |
|
99 printf("%s", str.ptr); |
|
100 if(synclog) { |
|
101 fprintf(synclog, "%s", str.ptr); |
|
102 } |
|
103 free(str.ptr); |
|
104 |
104 va_end(ap); |
105 va_end(ap); |
105 |
|
106 printf("%s\n", str.ptr); |
|
107 if(synclog) { |
|
108 fprintf(synclog, "%s%s%s\n", loglevel, sp, str.ptr); |
|
109 } |
|
110 } |
106 } |
111 |
107 |
112 /* |
108 /* |
113 * strcmp version that works with NULL pointers |
109 * strcmp version that works with NULL pointers |
114 */ |
110 */ |