| 1 |
/*************************************************************************** |
/* SPDX-License-Identifier: GPL-3.0-or-later */ |
| 2 |
log.c - description |
/* |
| 3 |
------------------- |
* log |
| 4 |
Copyright : (C) 2004-2025 by Leaflet |
* - logger |
| 5 |
Email : leaflet@leafok.com |
* |
| 6 |
***************************************************************************/ |
* Copyright (C) 2004-2025 Leaflet <leaflet@leafok.com> |
| 7 |
|
*/ |
|
/*************************************************************************** |
|
|
* * |
|
|
* This program is free software; you can redistribute it and/or modify * |
|
|
* it under the terms of the GNU General Public License as published by * |
|
|
* the Free Software Foundation; either version 3 of the License, or * |
|
|
* (at your option) any later version. * |
|
|
* * |
|
|
***************************************************************************/ |
|
| 8 |
|
|
|
#include "log.h" |
|
|
#include "io.h" |
|
| 9 |
#include "common.h" |
#include "common.h" |
| 10 |
|
#include "io.h" |
| 11 |
|
#include "log.h" |
| 12 |
#include <stdarg.h> |
#include <stdarg.h> |
| 13 |
#include <sys/types.h> |
#include <string.h> |
| 14 |
#include <time.h> |
#include <time.h> |
| 15 |
#include <unistd.h> |
#include <unistd.h> |
| 16 |
|
#include <sys/types.h> |
|
#define _POSIX_C_SOURCE 200809L |
|
|
#include <string.h> |
|
| 17 |
|
|
| 18 |
#define STR_LOG_TIME_MAX_LEN 50 |
#define STR_LOG_TIME_MAX_LEN 50 |
| 19 |
|
|
| 61 |
} |
} |
| 62 |
else // if (log_level == LOG_LEVEL_ERROR) |
else // if (log_level == LOG_LEVEL_ERROR) |
| 63 |
{ |
{ |
| 64 |
snprintf(buf, len, "[%s] [%d] [ERROR] [%s : %d] ", s_time, getpid(), app_file, app_line); |
snprintf(buf, len, "[%s] [%d] [ERROR] [%s:%d] ", s_time, getpid(), app_file, app_line); |
| 65 |
} |
} |
| 66 |
} |
} |
| 67 |
|
|