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