mirror of
https://github.com/gabime/spdlog.git
synced 2025-10-01 10:59:02 +08:00
pid support (added the %P option to formatter)
This commit is contained in:
@@ -356,6 +356,17 @@ inline std::string errno_str(int err_num)
|
||||
#endif
|
||||
}
|
||||
|
||||
inline int pid()
|
||||
{
|
||||
|
||||
#ifdef _WIN32
|
||||
return ::_getpid();
|
||||
#else
|
||||
return static_cast<int>(::getpid());
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
} //os
|
||||
} //details
|
||||
} //spdlog
|
||||
|
Reference in New Issue
Block a user