1
0
forked from metin2/server

Applied changes on the db executable. Removed old logging functions. Various global changes.

This commit is contained in:
2024-01-07 22:05:51 +02:00
parent 2f829ae2dc
commit feac4c0598
46 changed files with 748 additions and 1299 deletions

View File

@ -1,39 +1,12 @@
#ifndef __INC_LIBTHECORE_LOG_H__
#define __INC_LIBTHECORE_LOG_H__
#pragma once
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
extern int log_init(void);
extern void log_destroy(void);
extern void log_rotate(void);
extern int log_init(void);
extern void log_destroy(void);
// <20>α<EFBFBD> <20><><EFBFBD><EFBFBD> ó<><C3B3> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> bitvector<6F><72> ó<><C3B3><EFBFBD>ȴ<EFBFBD>)
extern void log_set_level(unsigned int level);
extern void log_unset_level(unsigned int level);
// <20>α<EFBFBD> <20><><EFBFBD><EFBFBD> ó<><C3B3> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> bitvector<6F><72> ó<><C3B3><EFBFBD>ȴ<EFBFBD>)
extern void log_set_level(unsigned int level);
extern void log_unset_level(unsigned int level);
// <20>α<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ŭ <20><><EFBFBD><EFBFBD><EFBFBD>ϴ°<CFB4><C2B0><EFBFBD> <20><><EFBFBD><EFBFBD> <20>Լ<EFBFBD>
extern void log_set_expiration_days(unsigned int days);
extern int log_get_expiration_days(void);
#ifndef __WIN32__
extern void _sys_err(const char *func, int line, const char *format, ...);
#else
extern void _sys_err(const char *func, int line, const char *format, ...);
#endif
extern void sys_log_header(const char *header);
extern void sys_log(unsigned int lv, const char *format, ...);
extern void pt_log(const char *format, ...);
#ifndef __WIN32__
#define sys_err(fmt, args...) _sys_err(__FUNCTION__, __LINE__, fmt, ##args)
#else
#define sys_err(fmt, ...) _sys_err(__FUNCTION__, __LINE__, fmt, __VA_ARGS__)
#endif // __WIN32__
#ifdef __cplusplus
}
#endif // __cplusplus
#endif // __INC_LOG_H__
// <20>α<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ŭ <20><><EFBFBD><EFBFBD><EFBFBD>ϴ°<CFB4><C2B0><EFBFBD> <20><><EFBFBD><EFBFBD> <20>Լ<EFBFBD>
extern void log_set_expiration_days(unsigned int days);
extern int log_get_expiration_days(void);

View File

@ -28,6 +28,9 @@
#include <bsd/string.h>
#define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_TRACE
#include <spdlog/spdlog.h>
#include <pthread.h>
#include <semaphore.h>

View File

@ -42,7 +42,7 @@ using Random = effolkronium::random_static;
#define CREATE(result, type, number) do { \
if (!((result) = (type *) calloc ((number), sizeof(type)))) { \
sys_err("calloc failed [%d] %s", errno, strerror(errno)); \
SPDLOG_CRITICAL("calloc failed [{}] {}", errno, strerror(errno)); \
abort(); } } while(0)
#define RECREATE(result,type,number) do { \