#include <unistd.h>
#include <pthread.h>
#include <time.h>
+#include <linux/limits.h>
#include <ventoy_define.h>
+extern char g_log_file[PATH_MAX];
static int g_ventoy_log_level = VLOG_DEBUG;
static pthread_mutex_t g_log_mutex;
va_end(arg);
pthread_mutex_lock(&g_log_mutex);
- fp = fopen(VTOY_LOG_FILE, "a+");
+ fp = fopen(g_log_file, "a+");
if (fp)
{
fprintf(fp, "[%04u/%02u/%02u %02u:%02u:%02u] %s\n",
va_end(arg);
pthread_mutex_lock(&g_log_mutex);
- fp = fopen(VTOY_LOG_FILE, "a+");
+ fp = fopen(g_log_file, "a+");
if (fp)
{
fprintf(fp, "[%04u/%02u/%02u %02u:%02u:%02u] %s",
va_end(arg);
pthread_mutex_lock(&g_log_mutex);
- fp = fopen(VTOY_LOG_FILE, "a+");
+ fp = fopen(g_log_file, "a+");
if (fp)
{
fprintf(fp, "[%04u/%02u/%02u %02u:%02u:%02u] %s",
- ttm.tm_year, ttm.tm_mon, ttm.tm_mday,
+ ttm.tm_year + 1900, ttm.tm_mon, ttm.tm_mday,
ttm.tm_hour, ttm.tm_min, ttm.tm_sec,
log);
fclose(fp);