init
This commit is contained in:
commit
b887f15662
21 changed files with 1038 additions and 0 deletions
15
include/Logger.h
Normal file
15
include/Logger.h
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#pragma once
|
||||
#include <iostream>
|
||||
#include <mutex>
|
||||
|
||||
class Logger {
|
||||
public:
|
||||
// 가변 인자 템플릿과 Fold Expression을 사용하여 여러 인자를 안전하게 출력
|
||||
template <typename... Args> static void Log(Args &&...args) {
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
(std::cout << ... << std::forward<Args>(args)) << std::endl;
|
||||
}
|
||||
|
||||
private:
|
||||
static inline std::mutex mutex_;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue