#include <iostream>
#include <filesystem>
#include <chrono>
#include <iomanip>
#include <sstream>
Go to the source code of this file.
|
#define | LOG(LEVEL, MESSAGE) |
|
◆ LOG
#define LOG |
( |
|
LEVEL, |
|
|
|
MESSAGE |
|
) |
| |
◆ getFileName()
static std::string getFileName |
( |
const std::string & |
path | ) |
|
|
inlinestatic |
Definition at line 33 of file logging.hpp.
34{
35 std::filesystem::path p(path);
36 return p.filename().string();
37}
◆ getTimestamp()
static std::string getTimestamp |
( |
| ) |
|
|
inlinestatic |
Definition at line 39 of file logging.hpp.
40{
41 auto now = std::chrono::system_clock::now();
42 auto now_ns = std::chrono::duration_cast<std::chrono::milliseconds>(
43 now.time_since_epoch())
44 .count();
45 std::ostringstream oss;
46 oss << now_ns;
47 return oss.str();
48}