From edd4b897ce89cb4ec3b15112e7d30fc8abb45f2e Mon Sep 17 00:00:00 2001 From: chatlanin Date: Wed, 10 Jul 2024 13:25:15 +0300 Subject: [PATCH] add log to console bool --- src/trs/trs.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/trs/trs.hpp b/src/trs/trs.hpp index 76fb9fb..080e883 100644 --- a/src/trs/trs.hpp +++ b/src/trs/trs.hpp @@ -38,6 +38,8 @@ namespace trs m_service_name = service_name; } + void log_to_console(bool v) { m_log_to_console = v; } + template void registration(std::string func_name, Function insp, Function func) { @@ -64,6 +66,7 @@ namespace trs private: std::string m_service_name; + bool m_log_to_console = true; function_manager m_function_manager; inspector m_inspector; @@ -100,7 +103,8 @@ namespace trs { ex.transaction(tr); ex.service(m_service_name); - ex.log(); + if (m_log_to_console) + ex.log(); ex.commit(); }