diff options
author | Alexander Kutsan <AKutsan@luxoft.com> | 2016-08-26 18:48:22 +0300 |
---|---|---|
committer | Alexander Kutsan <AKutsan@luxoft.com> | 2016-08-26 18:48:57 +0300 |
commit | d73e6dc8724c5799fae14efd4dcb214af74e4904 (patch) | |
tree | 9ebed8b422490c4d669e90e70783e4f5b55b65c9 /src/components/utils/src/auto_trace.cc | |
parent | c201c11a35d360c0b96f36b103a2590bfaeb6026 (diff) | |
parent | 61ef8c42badb879216f53d240e1101b9f83a9bb7 (diff) | |
download | sdl_core-d73e6dc8724c5799fae14efd4dcb214af74e4904.tar.gz |
Merge branch 'release/4.1.0'
Diffstat (limited to 'src/components/utils/src/auto_trace.cc')
-rw-r--r-- | src/components/utils/src/auto_trace.cc | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/components/utils/src/auto_trace.cc b/src/components/utils/src/auto_trace.cc index 5104851a51..0379630319 100644 --- a/src/components/utils/src/auto_trace.cc +++ b/src/components/utils/src/auto_trace.cc @@ -38,30 +38,28 @@ namespace logger { -AutoTrace::AutoTrace( - log4cxx::LoggerPtr logger, - const log4cxx::spi::LocationInfo& location) : - logger_(logger), location_(location) { - if (logger_->isTraceEnabled()) { +AutoTrace::AutoTrace(log4cxx::LoggerPtr logger, + const log4cxx::spi::LocationInfo& location) + : logger_(logger), location_(location) { + if (logger::logs_enabled() && logger_->isTraceEnabled()) { push_log(logger_, ::log4cxx::Level::getTrace(), "Enter", apr_time_now(), location_, - ::log4cxx::spi::LoggingEvent::getCurrentThreadName() - ); + ::log4cxx::spi::LoggingEvent::getCurrentThreadName()); } } AutoTrace::~AutoTrace() { - if (logger_->isTraceEnabled()) { + if (logger::logs_enabled() && logger_->isTraceEnabled()) { push_log(logger_, ::log4cxx::Level::getTrace(), "Exit", apr_time_now(), - location_, // the location corresponds rather to creation of autotrace object than to deletion - ::log4cxx::spi::LoggingEvent::getCurrentThreadName() - ); + location_, // the location corresponds rather to creation of + // autotrace object than to deletion + ::log4cxx::spi::LoggingEvent::getCurrentThreadName()); } } |