pid support (added the %P option to formatter)

This commit is contained in:
gabime
2016-12-02 17:09:00 +02:00
parent cda27d2bff
commit cf73f02eaf
2 changed files with 27 additions and 1 deletions

View File

@@ -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