From f39183b8d7656b618afc4043095dc3ab98b42d90 Mon Sep 17 00:00:00 2001 From: Johann Dreo Date: Thu, 16 Sep 2010 14:16:24 +0200 Subject: [PATCH] accessors to levels ; typofix on _contextLevel --- eo/src/utils/eoLogger.h | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/eo/src/utils/eoLogger.h b/eo/src/utils/eoLogger.h index 0a4c27e3..c9261698 100644 --- a/eo/src/utils/eoLogger.h +++ b/eo/src/utils/eoLogger.h @@ -143,8 +143,23 @@ public: virtual std::string className() const; + //! Print the available levels on the standard output + void printLevels() const; + + /*! Returns the selected levels, that is the one asked by the user + * + * Use this function if you want to be able to compare selected levels to a given one, like: + * if( eo::log.getLevelSelected() >= eo::progress ) {...} + */ + eo::Levels getLevelSelected() const { return _selectedLevel; } + + /*! Returns the current level of the context + * the one given when you output message with the logger + */ + eo::Levels getLevelContext() const { return _contextLevel; } + +protected: void addLevel(std::string name, eo::Levels level); - void printLevels() const; private: /** @@ -161,7 +176,7 @@ private: virtual int overflow(int_type c); private: const int& _fd; - const eo::Levels& _contexLevel; + const eo::Levels& _contextLevel; const eo::Levels& _selectedLevel; }; @@ -197,7 +212,7 @@ private: * _selectedLevel is the member storing verbose level setted by the user thanks to operator() */ eo::Levels _selectedLevel; - eo::Levels _contexLevel; + eo::Levels _contextLevel; /** * _fd in storing the file descriptor at this place we can disable easily the buffer in