add log to console bool
This commit is contained in:
parent
8c1f7e7cbc
commit
edd4b897ce
@ -38,6 +38,8 @@ namespace trs
|
|||||||
m_service_name = service_name;
|
m_service_name = service_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void log_to_console(bool v) { m_log_to_console = v; }
|
||||||
|
|
||||||
template<typename Function>
|
template<typename Function>
|
||||||
void registration(std::string func_name, Function insp, Function func)
|
void registration(std::string func_name, Function insp, Function func)
|
||||||
{
|
{
|
||||||
@ -64,6 +66,7 @@ namespace trs
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
std::string m_service_name;
|
std::string m_service_name;
|
||||||
|
bool m_log_to_console = true;
|
||||||
function_manager<transaction> m_function_manager;
|
function_manager<transaction> m_function_manager;
|
||||||
inspector<transaction> m_inspector;
|
inspector<transaction> m_inspector;
|
||||||
|
|
||||||
@ -100,7 +103,8 @@ namespace trs
|
|||||||
{
|
{
|
||||||
ex.transaction(tr);
|
ex.transaction(tr);
|
||||||
ex.service(m_service_name);
|
ex.service(m_service_name);
|
||||||
ex.log();
|
if (m_log_to_console)
|
||||||
|
ex.log();
|
||||||
ex.commit<database>();
|
ex.commit<database>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user