--- lbbs/src/log.c 2025/06/16 14:30:44 1.24 +++ lbbs/src/log.c 2025/11/05 04:19:21 1.30 @@ -1,36 +1,29 @@ -/*************************************************************************** - log.c - description - ------------------- - Copyright : (C) 2004-2025 by Leaflet - Email : leaflet@leafok.com - ***************************************************************************/ - -/*************************************************************************** - * * - * 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. * - * * - ***************************************************************************/ +/* SPDX-License-Identifier: GPL-3.0-or-later */ +/* + * log + * - logger + * + * Copyright (C) 2004-2025 Leaflet + */ -#define _POSIX_C_SOURCE 200809L - -#include "log.h" -#include "io.h" #include "common.h" +#include "io.h" +#include "log.h" #include #include #include #include #include -#define STR_LOG_TIME_MAX_LEN 50 +enum _log_constant_t +{ + STR_LOG_TIME_MAX_LEN = 50, +}; static FILE *fp_common_log; static FILE *fp_error_log; -int log_begin(char *common_log_file, char *error_log_file) +int log_begin(const char *common_log_file, const char *error_log_file) { fp_common_log = fopen(common_log_file, "a"); if (fp_common_log == NULL) @@ -75,7 +68,7 @@ inline static void log_head(char *buf, s } } -int log_printf(int log_level, const char *app_file, int app_line, const char *format, ...) +int log_printf(enum log_level_t log_level, const char *app_file, int app_line, const char *format, ...) { va_list args; int retval;