통합 로깅 유틸리티를 제공하는 헤더 파일입니다.
More...
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <ctime>
#include <cstdarg>
#include <mutex>
#include <format>
#include <thread>
#include <queue>
#include <condition_variable>
#include <filesystem>
#include <unistd.h>
#include <sys/stat.h>
Go to the source code of this file.
|
#define | SQLOG_H |
|
#define | SQLOGD_BUF_SIZE 4096 |
| 로깅 버퍼 크기
|
|
#define | RESOURCE_PATH "./output" |
| 로그 파일 저장 디렉토리
|
|
#define | SQLOG_I(format_str, ...) |
|
#define | SQLOG_E(format_str, ...) |
|
#define | SQLOG_F(format_str, ...) |
|
#define | SQLOG_D(format_str, ...) |
|
#define | SQLOG_W(format_str, ...) |
|
|
std::mutex | utils::log_mutex |
| 로깅 시스템 유틸리티 함수 및 전역 변수 모음.
|
|
std::queue< std::string > | utils::log_queue |
|
std::condition_variable | utils::log_cv |
|
bool | utils::log_thread_running = true |
|
통합 로깅 유틸리티를 제공하는 헤더 파일입니다.
◆ COUT_()
void utils::COUT_ |
( |
const std::string & | log_level, |
|
|
const std::string & | function, |
|
|
int | line, |
|
|
const char * | format_str, |
|
|
| ... ) |
|
inline |
실제 로그 메시지를 포맷팅하고 출력합니다.
- Parameters
-
log_level | 로그 레벨 ("INFO", "ERROR" 등) |
function | 호출한 함수 이름 |
line | 호출한 코드 라인 |
format_str | 출력할 문자열 포맷 |
... | 가변 인자 |
◆ ensureDirectoryExists()
void utils::ensureDirectoryExists |
( |
const std::string & | dirPath | ) |
|
|
inline |
디렉토리가 존재하지 않으면 생성합니다.
- Parameters
-
◆ getLogFilePath()
std::string utils::getLogFilePath |
( |
const std::string & | level | ) |
|
|
inline |
로그 파일 경로를 가져옵니다.
- Parameters
-
level | 로그 레벨 (ex: "INFO", "ERROR") |
- Returns
- 파일 경로 문자열
◆ getTimeString()
std::string utils::getTimeString |
( |
| ) |
|
|
inline |
현재 시스템 시간을 문자열로 반환합니다.
- Returns
- "YYYY-MM-DD HH:MM:SS" 형식의 시간 문자열
◆ logThreadFunc()
void utils::logThreadFunc |
( |
| ) |
|
|
inline |
백그라운드 로그 스레드 함수.
로그 큐를 비우면서 파일에 저장합니다.
◆ log_mutex
std::mutex utils::log_mutex |
|
inline |
로깅 시스템 유틸리티 함수 및 전역 변수 모음.
- 비동기 파일 로깅
- 콘솔 컬러 출력 (Windows 지원)
- 에러 코드(errno) 자동 출력 (디버그 모드)