diff --git a/log.cpp b/log.cpp index 0ad9099..f7e65a5 100644 --- a/log.cpp +++ b/log.cpp @@ -60,11 +60,11 @@ void dolog(const log_level_t ll, const char *fmt, ...) return; if (!lfh) { +#if !defined(ESP32) lfh = fopen(logfile, "a+"); if (!lfh) error_exit(true, "Cannot access log-file %s", logfile); -#if !defined(ESP32) if (lf_uid != -1 && fchown(fileno(lfh), lf_uid, lf_gid) == -1) error_exit(true, "Cannot change logfile (%s) ownership", logfile); @@ -95,8 +95,10 @@ void dolog(const log_level_t ll, const char *fmt, ...) (void)vasprintf(&str, fmt, ap); va_end(ap); +#if !defined(ESP32) if (ll >= log_level_file) fprintf(lfh, "%s%s\n", ts_str, str); +#endif if (ll >= log_level_screen) printf("%s%s\r\n", ts_str, str);