Build tool
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

logger.h 240B

1234567891011121314151617
  1. #pragma once
  2. #include <string>
  3. #include <mutex>
  4. #include <iostream>
  5. namespace logger {
  6. extern std::mutex mut;
  7. template<typename T>
  8. inline void log(const T &msg) {
  9. std::unique_lock<std::mutex> lock(mut);
  10. std::cerr << msg << '\n';
  11. }
  12. }