* #feat 增强Fatal级别的底色,修改logging类的方法

* 更新版本号

* 加入test脚本

* fix:conanfile

* test action

* 修复错别字

* add test on windows action

* fix test on windows action

* fix action on windows

* fix

* fix 内存分配错误

* fix msvc 不支持中文注释,删除中文注释

* test on windows and test  chinese char

* ersion 0.2.4

* feature:根据文件大小分割日志

* fix:内存泄露

* fix:使用char偏移单位
This commit is contained in:
youmetme
2024-11-20 11:56:47 +08:00
committed by GitHub
parent 650ce0dc3f
commit d0bfc31563
13 changed files with 231 additions and 93 deletions

15
src/utils/logging-utils.c Normal file
View File

@@ -0,0 +1,15 @@
#include "logging-utils.h"
#include <time.h>
#include <string.h>
/**
* @brief 获取当前时间字符串
* @param timeStr 存储时间字符串缓冲区指针
*/
void getTimeStr(char *timeStr) {
time_t t = time(NULL);
struct tm *p = localtime(&t);
char _timeStr[20];
strftime(_timeStr, sizeof(_timeStr), "%Y-%m-%d %H:%M:%S", p);
strcpy(timeStr, _timeStr);
}

View File

@@ -0,0 +1,5 @@
#ifndef __LOGGING_UTILS_H__
#define __LOGGING_UTILS_H__
void getTimeStr(char *timeStr);
#endif // __LOGGING_UTILS_H__