feat:[TS-3718]save slow log file one day one file

This commit is contained in:
wangmm0220 2024-08-02 17:16:13 +08:00
parent 0b663dbccc
commit 51ad50c603
1 changed files with 3 additions and 3 deletions

View File

@ -573,7 +573,7 @@ static inline int32_t taosBuildLogHead(char *buffer, const char *flags) {
}
static inline void taosPrintLogImp(ELogLevel level, int32_t dflag, const char *buffer, int32_t len) {
if ((dflag & DEBUG_FILE) && tsLogObj.logHandle && tsLogObj.logHandle->pFile != NULL && osLogSpaceAvailable()) {
if ((dflag & DEBUG_FILE) && tsLogObj.logHandle && tsLogObj.logHandle->pFile != NULL && osLogSpaceSufficient()) {
taosUpdateLogNums(level);
if (tsAsyncLog) {
(void)taosPushLogBuffer(tsLogObj.logHandle, buffer, len);
@ -621,7 +621,7 @@ void taosPrintLog(const char *flags, ELogLevel level, int32_t dflag, const char
}
void taosPrintLongString(const char *flags, ELogLevel level, int32_t dflag, const char *format, ...) {
if (!osLogSpaceAvailable()) return;
if (!osLogSpaceSufficient()) return;
if (!(dflag & DEBUG_FILE) && !(dflag & DEBUG_SCREEN)) return;
char *buffer = taosMemoryMalloc(LOG_MAX_LINE_DUMP_BUFFER_SIZE);
@ -656,7 +656,7 @@ static void checkSwitchSlowLogFile(){
(void)taosThreadMutexUnlock(&tsLogObj.logMutex);
}
void taosPrintSlowLog(const char *format, ...) {
if (!osLogSpaceAvailable()) return;
if (!osLogSpaceSufficient()) return;
char *buffer = taosMemoryMalloc(LOG_MAX_LINE_DUMP_BUFFER_SIZE);
int32_t len = taosBuildLogHead(buffer, "");