fix compile problem in otherplace

This commit is contained in:
lnk
2025-06-24 17:55:34 +08:00
parent 22c6b92af2
commit 98adfd3870
25 changed files with 779 additions and 12 deletions

View File

@@ -0,0 +1,472 @@
/* include/log4cplus/config.h. Generated from config.h.in by configure. */
/* include/log4cplus/config.h.in. Generated from configure.ac by autoheader. */
#ifndef LOG4CPLUS_CONFIG_H
#define LOG4CPLUS_CONFIG_H
/* define if the compiler supports basic C++11 syntax */
/* #undef HAVE_CXX11 */
/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1
/* Define to 1 if you have the `fcntl' function. */
#define HAVE_FCNTL 1
/* Define to 1 if you have the `flock' function. */
#define HAVE_FLOCK 1
/* Define to 1 if you have the `ftime' function. */
#define HAVE_FTIME 1
/* Define to 1 if the system has the `constructor' function attribute */
#define HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR 1
/* Define to 1 if the system has the `constructor_priority' function attribute
*/
#define HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR_PRIORITY 1
/* */
#define HAVE_GETADDRINFO 1
/* */
#define HAVE_GETHOSTBYNAME_R 1
/* Define to 1 if you have the `getpid' function. */
#define HAVE_GETPID 1
/* Define to 1 if you have the `gmtime_r' function. */
#define HAVE_GMTIME_R 1
/* Define to 1 if you have the `htonl' function. */
#define HAVE_HTONL 1
/* Define to 1 if you have the `htons' function. */
#define HAVE_HTONS 1
/* Define to 1 if you have the `iconv' function. */
/* #undef HAVE_ICONV */
/* Define to 1 if you have the `iconv_close' function. */
/* #undef HAVE_ICONV_CLOSE */
/* Define to 1 if you have the `iconv_open' function. */
/* #undef HAVE_ICONV_OPEN */
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the `advapi32' library (-ladvapi32). */
/* #undef HAVE_LIBADVAPI32 */
/* Define to 1 if you have the `libiconv' function. */
/* #undef HAVE_LIBICONV */
/* Define to 1 if you have the `libiconv_close' function. */
/* #undef HAVE_LIBICONV_CLOSE */
/* Define to 1 if you have the `libiconv_open' function. */
/* #undef HAVE_LIBICONV_OPEN */
/* Define to 1 if you have the `kernel32' library (-lkernel32). */
/* #undef HAVE_LIBKERNEL32 */
/* Define to 1 if you have the `oleaut32' library (-loleaut32). */
/* #undef HAVE_LIBOLEAUT32 */
/* Define to 1 if you have the `ws2_32' library (-lws2_32). */
/* #undef HAVE_LIBWS2_32 */
/* Define to 1 if you have the `localtime_r' function. */
#define HAVE_LOCALTIME_R 1
/* Define to 1 if you have the `lockf' function. */
#define HAVE_LOCKF 1
/* Define to 1 if you have the `lstat' function. */
#define HAVE_LSTAT 1
/* Define to 1 if you have the `mbstowcs' function. */
#define HAVE_MBSTOWCS 1
/* Define to 1 if you have the <memory.h> header file. */
/* #undef HAVE_MEMORY_H */
/* Define to 1 if you have the `ntohl' function. */
#define HAVE_NTOHL 1
/* Define to 1 if you have the `ntohs' function. */
#define HAVE_NTOHS 1
/* Define to 1 if you have the `OutputDebugStringW' function. */
/* #undef HAVE_OUTPUTDEBUGSTRINGW */
/* Define to 1 if you have the `pipe' function. */
#define HAVE_PIPE 1
/* Define to 1 if you have the `pipe2' function. */
#define HAVE_PIPE2 1
/* Define to 1 if you have the `poll' function. */
#define HAVE_POLL 1
/* Define if you have POSIX threads libraries and header files. */
#define HAVE_PTHREAD 1
/* Have PTHREAD_PRIO_INHERIT. */
#define HAVE_PTHREAD_PRIO_INHERIT 1
/* If available, contains the Python version number currently in use. */
/* #undef HAVE_PYTHON */
/* Define to 1 if you have the `shutdown' function. */
#define HAVE_SHUTDOWN 1
/* Define to 1 if you have the `stat' function. */
#define HAVE_STAT 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Defined if the compiler understands __thread or __declspec(thread)
construct. */
#define HAVE_TLS_SUPPORT 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if the system has the `init_priority' variable attribute */
#define HAVE_VAR_ATTRIBUTE_INIT_PRIORITY 1
/* Define to 1 if you have the `vfprintf_s' function. */
/* #undef HAVE_VFPRINTF_S */
/* Define to 1 if you have the `vfwprintf_s' function. */
/* #undef HAVE_VFWPRINTF_S */
/* Define to 1 if you have the `vsnprintf' function. */
#define HAVE_VSNPRINTF 1
/* Define to 1 if you have the `vsnwprintf' function. */
/* #undef HAVE_VSNWPRINTF */
/* Define to 1 if you have the `vsprintf_s' function. */
/* #undef HAVE_VSPRINTF_S */
/* Define to 1 if you have the `vswprintf_s' function. */
/* #undef HAVE_VSWPRINTF_S */
/* Define to 1 if you have the `wcstombs' function. */
#define HAVE_WCSTOMBS 1
/* Define to 1 if you have the `_vsnprintf' function. */
/* #undef HAVE__VSNPRINTF */
/* Define to 1 if you have the `_vsnprintf_s' function. */
/* #undef HAVE__VSNPRINTF_S */
/* Define to 1 if you have the `_vsnwprintf' function. */
/* #undef HAVE__VSNWPRINTF */
/* Define to 1 if you have the `_vsnwprintf_s' function. */
/* #undef HAVE__VSNWPRINTF_S */
/* Defined if the compiler supports __FUNCTION__ macro. */
/* #undef HAVE___FUNCTION___MACRO */
/* Defined if the compiler supports __func__ symbol. */
/* #undef HAVE___FUNC___SYMBOL */
/* Defined if the compiler supports __PRETTY_FUNCTION__ macro. */
/* #undef HAVE___PRETTY_FUNCTION___MACRO */
/* Defined for --enable-debugging builds. */
/* #undef LOG4CPLUS_DEBUGGING */
/* Defined if the compiler understands __declspec(dllimport) or
__attribute__((visibility("default"))) or __global construct. */
#define LOG4CPLUS_DECLSPEC_EXPORT __attribute__ ((visibility("default")))
/* Defined if the compiler understands __declspec(dllimport) or
__attribute__((visibility("default"))) or __global construct. */
#define LOG4CPLUS_DECLSPEC_IMPORT __attribute__ ((visibility("default")))
/* Defined if the compiler understands __attribute__((visibility("hidden")))
or __hidden construct. */
#define LOG4CPLUS_DECLSPEC_PRIVATE __attribute__ ((visibility("hidden")))
/* */
#define LOG4CPLUS_HAVE_ARPA_INET_H 1
/* */
#define LOG4CPLUS_HAVE_ENAMETOOLONG 1
/* */
#define LOG4CPLUS_HAVE_ERRNO_H 1
/* */
#define LOG4CPLUS_HAVE_FCNTL 1
/* */
#define LOG4CPLUS_HAVE_FCNTL_H 1
/* */
#define LOG4CPLUS_HAVE_FLOCK 1
/* */
#define LOG4CPLUS_HAVE_FTIME 1
/* */
#define LOG4CPLUS_HAVE_FUNCTION_MACRO 1
/* */
#define LOG4CPLUS_HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR 1
/* */
#define LOG4CPLUS_HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR_PRIORITY 1
/* */
#define LOG4CPLUS_HAVE_FUNC_SYMBOL 1
/* */
#define LOG4CPLUS_HAVE_GETADDRINFO 1
/* */
#define LOG4CPLUS_HAVE_GETHOSTBYNAME_R 1
/* */
#define LOG4CPLUS_HAVE_GETPID 1
/* */
#define LOG4CPLUS_HAVE_GETTID 1
/* */
#define LOG4CPLUS_HAVE_GMTIME_R 1
/* */
#define LOG4CPLUS_HAVE_HTONL 1
/* */
#define LOG4CPLUS_HAVE_HTONS 1
/* */
/* #undef LOG4CPLUS_HAVE_ICONV */
/* */
/* #undef LOG4CPLUS_HAVE_ICONV_CLOSE */
/* */
/* #undef LOG4CPLUS_HAVE_ICONV_H */
/* */
/* #undef LOG4CPLUS_HAVE_ICONV_OPEN */
/* */
#define LOG4CPLUS_HAVE_LIMITS_H 1
/* */
#define LOG4CPLUS_HAVE_LOCALTIME_R 1
/* */
#define LOG4CPLUS_HAVE_LOCKF 1
/* */
#define LOG4CPLUS_HAVE_LSTAT 1
/* */
#define LOG4CPLUS_HAVE_MBSTOWCS 1
/* */
#define LOG4CPLUS_HAVE_NETDB_H 1
/* */
#define LOG4CPLUS_HAVE_NETINET_IN_H 1
/* */
#define LOG4CPLUS_HAVE_NETINET_TCP_H 1
/* */
#define LOG4CPLUS_HAVE_NTOHL 1
/* */
#define LOG4CPLUS_HAVE_NTOHS 1
/* */
/* #undef LOG4CPLUS_HAVE_OUTPUTDEBUGSTRING */
/* */
#define LOG4CPLUS_HAVE_PIPE 1
/* */
#define LOG4CPLUS_HAVE_PIPE2 1
/* */
#define LOG4CPLUS_HAVE_POLL 1
/* */
#define LOG4CPLUS_HAVE_POLL_H 1
/* */
#define LOG4CPLUS_HAVE_PRETTY_FUNCTION_MACRO 1
/* */
#define LOG4CPLUS_HAVE_SHUTDOWN 1
/* */
#define LOG4CPLUS_HAVE_STAT 1
/* */
#define LOG4CPLUS_HAVE_STDARG_H 1
/* */
#define LOG4CPLUS_HAVE_STDIO_H 1
/* */
#define LOG4CPLUS_HAVE_STDLIB_H 1
/* */
#define LOG4CPLUS_HAVE_SYSLOG_H 1
/* */
#define LOG4CPLUS_HAVE_SYS_FILE_H 1
/* */
#define LOG4CPLUS_HAVE_SYS_SOCKET_H 1
/* */
#define LOG4CPLUS_HAVE_SYS_STAT_H 1
/* */
#define LOG4CPLUS_HAVE_SYS_SYSCALL_H 1
/* */
#define LOG4CPLUS_HAVE_SYS_TIMEB_H 1
/* */
#define LOG4CPLUS_HAVE_SYS_TIME_H 1
/* */
#define LOG4CPLUS_HAVE_SYS_TYPES_H 1
/* */
#define LOG4CPLUS_HAVE_TIME_H 1
/* */
#define LOG4CPLUS_HAVE_TLS_SUPPORT 1
/* */
#define LOG4CPLUS_HAVE_UNISTD_H 1
/* */
#define LOG4CPLUS_HAVE_VAR_ATTRIBUTE_INIT_PRIORITY 1
/* */
/* #undef LOG4CPLUS_HAVE_VFPRINTF_S */
/* */
/* #undef LOG4CPLUS_HAVE_VFWPRINTF_S */
/* */
#define LOG4CPLUS_HAVE_VSNPRINTF 1
/* */
/* #undef LOG4CPLUS_HAVE_VSNWPRINTF */
/* */
/* #undef LOG4CPLUS_HAVE_VSPRINTF_S */
/* */
/* #undef LOG4CPLUS_HAVE_VSWPRINTF_S */
/* */
#define LOG4CPLUS_HAVE_WCHAR_H 1
/* */
#define LOG4CPLUS_HAVE_WCSTOMBS 1
/* */
/* #undef LOG4CPLUS_HAVE__VSNPRINTF */
/* */
/* #undef LOG4CPLUS_HAVE__VSNPRINTF_S */
/* */
/* #undef LOG4CPLUS_HAVE__VSNWPRINTF */
/* */
/* #undef LOG4CPLUS_HAVE__VSNWPRINTF_S */
/* Define if this is a single-threaded library. */
/* #undef LOG4CPLUS_SINGLE_THREADED */
/* */
#define LOG4CPLUS_THREAD_LOCAL_VAR thread_local
/* */
/* #undef LOG4CPLUS_USE_PTHREADS */
/* Define when iconv() is available. */
/* #undef LOG4CPLUS_WITH_ICONV */
/* Defined to enable unit tests. */
/* #undef LOG4CPLUS_WITH_UNIT_TESTS */
/* Define for C99 compilers/standard libraries that support more than just the
"C" locale. */
/* #undef LOG4CPLUS_WORKING_C_LOCALE */
/* Define for compilers/standard libraries that support more than just the "C"
locale. */
/* #undef LOG4CPLUS_WORKING_LOCALE */
/* Define to the sub-directory where libtool stores uninstalled libraries. */
#define LT_OBJDIR ".libs/"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT ""
/* Define to the full name of this package. */
#define PACKAGE_NAME "log4cplus"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "log4cplus 2.1.2"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "log4cplus"
/* Define to the home page for this package. */
#define PACKAGE_URL ""
/* Define to the version of this package. */
#define PACKAGE_VERSION "2.1.2"
/* Define to necessary symbol if this constant uses a non-standard name on
your system. */
/* #undef PTHREAD_CREATE_JOINABLE */
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Defined to the actual TLS support construct. */
#define TLS_SUPPORT_CONSTRUCT thread_local
/* Substitute for socklen_t */
/* #undef socklen_t */
#endif // LOG4CPLUS_CONFIG_H

View File

@@ -0,0 +1,248 @@
/* include/log4cplus/config/defines.hxx. Generated from defines.hxx.in by configure. */
#ifndef LOG4CPLUS_CONFIG_DEFINES_HXX
#define LOG4CPLUS_CONFIG_DEFINES_HXX
/* */
#define LOG4CPLUS_HAVE_SYSLOG_H 1
/* */
#define LOG4CPLUS_HAVE_ARPA_INET_H 1
/* */
#define LOG4CPLUS_HAVE_NETINET_IN_H 1
/* */
#define LOG4CPLUS_HAVE_NETINET_TCP_H 1
/* */
#define LOG4CPLUS_HAVE_SYS_TIMEB_H 1
/* */
#define LOG4CPLUS_HAVE_SYS_TIME_H 1
/* */
#define LOG4CPLUS_HAVE_SYS_TYPES_H 1
/* */
#define LOG4CPLUS_HAVE_SYS_STAT_H 1
/* */
#define LOG4CPLUS_HAVE_SYS_SYSCALL_H 1
/* */
#define LOG4CPLUS_HAVE_SYS_FILE_H 1
/* */
#define LOG4CPLUS_HAVE_TIME_H 1
/* */
#define LOG4CPLUS_HAVE_SYS_SOCKET_H 1
/* */
#define LOG4CPLUS_HAVE_NETDB_H 1
/* */
#define LOG4CPLUS_HAVE_UNISTD_H 1
/* */
#define LOG4CPLUS_HAVE_FCNTL_H 1
/* */
#define LOG4CPLUS_HAVE_STDARG_H 1
/* */
#define LOG4CPLUS_HAVE_STDIO_H 1
/* */
#define LOG4CPLUS_HAVE_STDLIB_H 1
/* */
#define LOG4CPLUS_HAVE_ERRNO_H 1
/* */
#define LOG4CPLUS_HAVE_WCHAR_H 1
/* */
/* #undef LOG4CPLUS_HAVE_ICONV_H */
/* */
#define LOG4CPLUS_HAVE_LIMITS_H 1
/* */
#define LOG4CPLUS_HAVE_FTIME 1
/* */
#define LOG4CPLUS_HAVE_GETADDRINFO 1
/* */
#define LOG4CPLUS_HAVE_GETHOSTBYNAME_R 1
/* */
#define LOG4CPLUS_HAVE_GETPID 1
/* */
#define LOG4CPLUS_HAVE_GMTIME_R 1
/* */
#define LOG4CPLUS_HAVE_HTONL 1
/* */
#define LOG4CPLUS_HAVE_HTONS 1
/* */
#define LOG4CPLUS_HAVE_LOCALTIME_R 1
/* */
#define LOG4CPLUS_HAVE_LSTAT 1
/* */
#define LOG4CPLUS_HAVE_FCNTL 1
/* */
#define LOG4CPLUS_HAVE_LOCKF 1
/* */
#define LOG4CPLUS_HAVE_FLOCK 1
/* */
#define LOG4CPLUS_HAVE_NTOHL 1
/* */
#define LOG4CPLUS_HAVE_NTOHS 1
/* Define to 1 if you have the `shutdown' function. */
#define LOG4CPLUS_HAVE_SHUTDOWN 1
/* */
#define LOG4CPLUS_HAVE_PIPE 1
/* */
#define LOG4CPLUS_HAVE_PIPE2 1
/* */
#define LOG4CPLUS_HAVE_POLL 1
/* */
#define LOG4CPLUS_HAVE_POLL_H 1
/* */
#define LOG4CPLUS_HAVE_STAT 1
/* Define if this is a single-threaded library. */
/* #undef LOG4CPLUS_SINGLE_THREADED */
/* */
/* #undef LOG4CPLUS_USE_PTHREADS */
/* Define for compilers/standard libraries that support more than just the "C"
locale. */
/* #undef LOG4CPLUS_WORKING_LOCALE */
/* Define for C99 compilers/standard libraries that support more than just the
"C" locale. */
/* #undef LOG4CPLUS_WORKING_C_LOCALE */
/* Define to int if undefined. */
/* #undef socklen_t */
/* Defined for --enable-debugging builds. */
/* #undef LOG4CPLUS_DEBUGGING */
/* Defined if the compiler understands __declspec(dllexport) or
__attribute__((visibility("default"))) construct. */
#define LOG4CPLUS_DECLSPEC_EXPORT __attribute__ ((visibility("default")))
/* Defined if the compiler understands __declspec(dllimport) or
__attribute__((visibility("default"))) construct. */
#define LOG4CPLUS_DECLSPEC_IMPORT __attribute__ ((visibility("default")))
/* Defined if the compiler understands
__attribute__((visibility("hidden"))) construct. */
#define LOG4CPLUS_DECLSPEC_PRIVATE __attribute__ ((visibility("hidden")))
/* */
#define LOG4CPLUS_HAVE_TLS_SUPPORT 1
/* */
#define LOG4CPLUS_THREAD_LOCAL_VAR thread_local
/* Defined if the host OS provides ENAMETOOLONG errno value. */
#define LOG4CPLUS_HAVE_ENAMETOOLONG 1
/* */
#define LOG4CPLUS_HAVE_VSNPRINTF 1
/* Define to 1 if you have the `vsnwprintf' function. */
/* #undef LOG4CPLUS_HAVE_VSNWPRINTF */
/* Define to 1 if you have the `_vsnwprintf' function. */
/* #undef LOG4CPLUS_HAVE__VSNWPRINTF */
/* */
/* #undef LOG4CPLUS_HAVE__VSNPRINTF */
/* Define to 1 if you have the `vfprintf_s' function. */
/* #undef LOG4CPLUS_HAVE_VFPRINTF_S */
/* Define to 1 if you have the `vfwprintf_s' function. */
/* #undef LOG4CPLUS_HAVE_VFWPRINTF_S */
/* Define to 1 if you have the `vsprintf_s' function. */
/* #undef LOG4CPLUS_HAVE_VSPRINTF_S */
/* Define to 1 if you have the `vswprintf_s' function. */
/* #undef LOG4CPLUS_HAVE_VSWPRINTF_S */
/* Define to 1 if you have the `_vsnprintf_s' function. */
/* #undef LOG4CPLUS_HAVE__VSNPRINTF_S */
/* Define to 1 if you have the `_vsnwprintf_s' function. */
/* #undef LOG4CPLUS_HAVE__VSNWPRINTF_S */
/* Defined if the compiler supports __FUNCTION__ macro. */
#define LOG4CPLUS_HAVE_FUNCTION_MACRO 1
/* Defined if the compiler supports __PRETTY_FUNCTION__ macro. */
#define LOG4CPLUS_HAVE_PRETTY_FUNCTION_MACRO 1
/* Defined if the compiler supports __func__ symbol. */
#define LOG4CPLUS_HAVE_FUNC_SYMBOL 1
/* Define to 1 if you have the `mbstowcs' function. */
#define LOG4CPLUS_HAVE_MBSTOWCS 1
/* Define to 1 if you have the `wcstombs' function. */
#define LOG4CPLUS_HAVE_WCSTOMBS 1
/* Define to 1 if you have Linux style syscall(SYS_gettid). */
#define LOG4CPLUS_HAVE_GETTID 1
/* Define when iconv() is available. */
/* #undef LOG4CPLUS_WITH_ICONV */
/* Define to 1 if you have the `iconv' function. */
/* #undef LOG4CPLUS_HAVE_ICONV */
/* Define to 1 if you have the `iconv_close' function. */
/* #undef LOG4CPLUS_HAVE_ICONV_CLOSE */
/* Define to 1 if you have the `iconv_open' function. */
/* #undef LOG4CPLUS_HAVE_ICONV_OPEN */
/* Define to 1 if you have the `OutputDebugString' function. */
/* #undef LOG4CPLUS_HAVE_OUTPUTDEBUGSTRING */
/* Define to 1 if the system has the `constructor' function attribute
with priority */
#define LOG4CPLUS_HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR_PRIORITY 1
/* Define to 1 if the system has the `constructor' function attribute */
#define LOG4CPLUS_HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR 1
/* Define to 1 if the system has the `init_priority' variable attribute */
#define LOG4CPLUS_HAVE_VAR_ATTRIBUTE_INIT_PRIORITY 1
/* Defined to enable unit tests. */
/* #undef LOG4CPLUS_WITH_UNIT_TESTS */
#endif // LOG4CPLUS_CONFIG_DEFINES_HXX

View File

@@ -0,0 +1 @@
timestamp for include/log4cplus/config/defines.hxx

View File

@@ -1,111 +0,0 @@
#ifndef LOG4_H
#define LOG4_H
#ifdef __cplusplus
#include <string>
#include <map>
//防止#include <log4cplus/logger.h>里的冲突
#ifdef min
#undef min
#endif
#ifdef max
#undef max
#endif
//防止#include <log4cplus/logger.h>里的冲突
#include "logger.h"
#include <set>
#include "loggingmacros.h"
#include "appender.h"
#define LOGTYPE_COM 1
#define LOGTYPE_DATA 2
struct TypedLogger {
log4cplus::Logger logger;
int logtype;
TypedLogger();
TypedLogger(const log4cplus::Logger& l, int t);
};
struct DebugSwitch {
bool debug_open;
std::set<std::string> targets;
int min_level;
std::map<int, bool> type_enable;
DebugSwitch();
void open();
void close();
void set_target(const std::string& name);
void set_level(int level);
void enable_type(int type);
void disable_type(int type);
bool match(const std::string& logger_name, int level, int logtype);
};
extern std::map<std::string, TypedLogger> logger_map;
extern DebugSwitch g_debug_switch;
extern void send_reply_to_queue(const std::string& guid, const std::string& step, const std::string& result);
std::string get_front_type_from_subdir();
// 不带 Appender 的版本
log4cplus::Logger init_logger(const std::string& full_name,
const std::string& file_dir,
const std::string& base_file);
// 带 Appender 的版本
log4cplus::Logger init_logger(const std::string& full_name,
const std::string& file_dir,
const std::string& base_file,
log4cplus::SharedAppenderPtr fileAppender);
void process_log_command(const std::string& id, const std::string& level, const std::string& grade, const std::string& logtype_str);
void update_log_entries_countdown();
extern "C" {
#endif
void remove_loggers_by_terminal_id(const std::string& terminal_id_cstr);
void init_logger_process();
void init_loggers();
void init_loggers_bydevid(const std::string& dev_id);
void log_debug(const char* key, const char* msg);
void log_info(const char* key, const char* msg);
void log_warn(const char* key, const char* msg);
void log_error(const char* key, const char* msg);
void send_reply_to_queue_c(const char* guid, const char* step, const char* result);
void format_log_msg(char* buf, size_t buf_size, const char* fmt, ...);
//宏定义
#define DIY_LOG(LEVEL_FUNC, KEY, ...) \
do { \
char buf[256]; \
format_log_msg(buf, sizeof(buf), __VA_ARGS__); \
LEVEL_FUNC(KEY, buf); \
} while (0)
#define DIY_ERRORLOG(KEY, ...) DIY_LOG(log_error, KEY, __VA_ARGS__)
#define DIY_WARNLOG(KEY, ...) DIY_LOG(log_warn, KEY, __VA_ARGS__)
#define DIY_INFOLOG(KEY, ...) DIY_LOG(log_info, KEY, __VA_ARGS__)
#define DIY_DEBUGLOG(KEY, ...) DIY_LOG(log_debug, KEY, __VA_ARGS__)
#ifdef __cplusplus
}
#endif
#endif // LOG4_H

View File

@@ -0,0 +1 @@
timestamp for include/log4cplus/config.h