mirror of
https://github.com/gabime/spdlog.git
synced 2025-04-01 02:42:41 +08:00
format
This commit is contained in:
parent
da0d6d0478
commit
6d5670fde7
@ -9,13 +9,13 @@
|
|||||||
|
|
||||||
#include "spdlog/tweakme.h"
|
#include "spdlog/tweakme.h"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <stdexcept>
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <algorithm>
|
|
||||||
#include <initializer_list>
|
#include <initializer_list>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <stdexcept>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
@ -147,11 +147,18 @@ enum class pattern_time_type
|
|||||||
class spdlog_ex : public std::runtime_error
|
class spdlog_ex : public std::runtime_error
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit spdlog_ex(const std::string& msg) : runtime_error(msg){}
|
explicit spdlog_ex(const std::string &msg)
|
||||||
spdlog_ex(const std::string& msg, int last_errno) : runtime_error(msg), last_errno_(last_errno){}
|
: runtime_error(msg)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
spdlog_ex(const std::string &msg, int last_errno)
|
||||||
|
: runtime_error(msg)
|
||||||
|
, last_errno_(last_errno)
|
||||||
|
{
|
||||||
|
}
|
||||||
const char *what() const SPDLOG_NOEXCEPT override
|
const char *what() const SPDLOG_NOEXCEPT override
|
||||||
{
|
{
|
||||||
if(last_errno_)
|
if (last_errno_)
|
||||||
{
|
{
|
||||||
fmt::memory_buffer buf;
|
fmt::memory_buffer buf;
|
||||||
std::string msg(runtime_error::what());
|
std::string msg(runtime_error::what());
|
||||||
@ -166,7 +173,6 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
int last_errno_{0};
|
int last_errno_{0};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
|
Loading…
Reference in New Issue
Block a user