diff options
Diffstat (limited to 'parameter/AutoLog.cpp')
-rw-r--r-- | parameter/AutoLog.cpp | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/parameter/AutoLog.cpp b/parameter/AutoLog.cpp index 629d57b..eb59b01 100644 --- a/parameter/AutoLog.cpp +++ b/parameter/AutoLog.cpp @@ -24,20 +24,23 @@ */ #include "AutoLog.h" -CAutoLog::CAutoLog(const CElement* pElement, const string& strContext) : _pElement(pElement), _strContext(strContext) +CAutoLog::CAutoLog(const CElement* pElement, const string& strContext, bool bLogOn) + : _pElement(pElement), _strContext(strContext), _bLogOn(bLogOn) { - // Log - _pElement->doLog(_strContext + " {"); - - // Nest - _pElement->nestLog(); + if (_bLogOn) { + // Log + _pElement->doLog(_strContext + " {"); + // Nest + _pElement->nestLog(); + } } CAutoLog::~CAutoLog() { - // Unnest - _pElement->unnestLog(); - - // Log - _pElement->doLog( "} " + _strContext); + if (_bLogOn) { + // Unnest + _pElement->unnestLog(); + // Log + _pElement->doLog( "} " + _strContext); + } } |