add function name
This commit is contained in:
parent
27f222adce
commit
63c712207d
@ -55,8 +55,9 @@ namespace hack
|
||||
|
||||
void log()
|
||||
{
|
||||
error("", m_location)(m_message);
|
||||
warn("", m_location)(m_description);
|
||||
error(" : ", m_location)(m_service, m_message);
|
||||
if (!m_description.empty())
|
||||
warn("", m_location)(m_description);
|
||||
if (!m_system_error.empty())
|
||||
warn("", m_location)("system_error: ", m_system_error);
|
||||
}
|
||||
@ -68,9 +69,10 @@ namespace hack
|
||||
j["description"] = m_description;
|
||||
j["system_error"] = m_system_error;
|
||||
j["location"] = m_location.file_name();
|
||||
j["params"] = m_params;
|
||||
j["function"] = m_location.function_name();
|
||||
j["message"] = m_message;
|
||||
j["service"] = m_service;
|
||||
j["params"] = m_params;
|
||||
|
||||
return j;
|
||||
}
|
||||
|
@ -5,6 +5,7 @@
|
||||
auto main(int argc, char *argv[]) -> int
|
||||
{
|
||||
hack::exception ex;
|
||||
ex.service("test service");
|
||||
ex.log();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user