remove dead codepath, we dont need gz logs

This commit is contained in:
2026-07-02 00:53:03 +02:00
parent 3d869b5169
commit 2f8d08a1f9
2 changed files with 0 additions and 39 deletions

View File

@@ -5,9 +5,6 @@
/* comment out to disable all logging */
#define APPLOG_ENABLED
/* comment out to disable file logging */
/* #define LOG_FILE_LOCATION "linuxSmartie.log.gz" */
/* ─────────────────────────────────────────────────────────────────────── */
#ifdef APPLOG_ENABLED

View File

@@ -6,12 +6,6 @@
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#ifdef LOG_FILE_LOCATION
#include <zlib.h>
static pthread_mutex_t fmtx = PTHREAD_MUTEX_INITIALIZER;
#endif
static pthread_mutex_t cmtx = PTHREAD_MUTEX_INITIALIZER;
@@ -74,36 +68,6 @@ void log_write(const log_level_t level, const char *func, const char *fmt, ...)
pthread_mutex_unlock(&cmtx);
va_end(ap);
}
#ifdef LOG_FILE_LOCATION
/* ── file ────────────────────────────────────────────────────────── */
{
char timebuf[32];
struct timespec ts;
clock_gettime(CLOCK_REALTIME, &ts);
struct tm tm_info;
localtime_r(&ts.tv_sec, &tm_info);
strftime(timebuf, sizeof(timebuf), "%x %H:%M:%S", &tm_info);
char msgbuf[1024];
va_list ap;
va_start(ap, fmt);
int offset = snprintf(msgbuf, sizeof(msgbuf),
"%s.%03ld [%s%s%s] ",
timebuf, ts.tv_nsec / 1000000L,
color, funcname, reset);
vsnprintf(msgbuf + offset, sizeof(msgbuf) - offset, fmt, ap);
va_end(ap);
pthread_mutex_lock(&fmtx);
gzFile file = gzopen(LOG_FILE_LOCATION, "ab");
if (file) {
gzprintf(file, "%s\n", msgbuf);
gzclose(file);
}
pthread_mutex_unlock(&fmtx);
}
#endif /* LOG_FILE_LOCATION */
}
#endif /* APPLOG_ENABLED */