diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-03-25 19:27:30 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-04-10 21:05:07 +0100 |
commit | e7fabbd47093e05344b9a977ba7641280a64ef32 (patch) | |
tree | eeec8c9d86830caa49ded65e9805ecf382633d8e /external/easylogging++/easylogging++.h | |
parent | update easylogging++ to latest upstream (diff) | |
download | monero-e7fabbd47093e05344b9a977ba7641280a64ef32.tar.xz |
easylogging++: add categories
Diffstat (limited to 'external/easylogging++/easylogging++.h')
-rw-r--r-- | external/easylogging++/easylogging++.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/external/easylogging++/easylogging++.h b/external/easylogging++/easylogging++.h index 8f8a71733..98dcb0b5c 100644 --- a/external/easylogging++/easylogging++.h +++ b/external/easylogging++/easylogging++.h @@ -365,6 +365,7 @@ ELPP_INTERNAL_DEBUGGING_OUT_INFO << ELPP_INTERNAL_DEBUGGING_MSG(internalInfoStre #include <string> #include <vector> #include <map> +#include <deque> #include <utility> #include <functional> #include <algorithm> @@ -581,6 +582,10 @@ class LevelHelper : base::StaticClass { /// @brief Converts level to associated const char* /// @return Upper case string based level. static const char* convertToString(Level level); + /// @brief Converts from prefix of levelStr to Level + /// @param levelStr Upper case string based level. + /// Lower case is also valid but providing upper case is recommended. + static Level convertFromStringPrefix(const char* levelStr); /// @brief Converts from levelStr to Level /// @param levelStr Upper case string based level. /// Lower case is also valid but providing upper case is recommended. @@ -2454,13 +2459,22 @@ class VRegistry : base::NoCopy, public base::threading::ThreadSafe { return m_level; } + inline void clearCategories(void) { + base::threading::ScopedLock scopedLock(lock()); + m_categories.clear(); + } + inline void clearModules(void) { base::threading::ScopedLock scopedLock(lock()); m_modules.clear(); } + void setCategories(const char* categories, bool clear = true); + void setModules(const char* modules); + bool allowed(Level level, const char* category); + bool allowed(base::type::VerboseLevel vlevel, const char* file); inline const std::map<std::string, base::type::VerboseLevel>& modules(void) const { @@ -2478,6 +2492,7 @@ class VRegistry : base::NoCopy, public base::threading::ThreadSafe { base::type::VerboseLevel m_level; base::type::EnumType* m_pFlags; std::map<std::string, base::type::VerboseLevel> m_modules; + std::deque<std::pair<std::string, Level>> m_categories; }; } // namespace base class LogMessage { @@ -3897,8 +3912,12 @@ class Loggers : base::StaticClass { static base::type::VerboseLevel verboseLevel(void); /// @brief Sets vmodules as specified (on the fly) static void setVModules(const char* modules); + /// @brief Sets categories as specified (on the fly) + static void setCategories(const char* categories, bool clear = true); /// @brief Clears vmodules static void clearVModules(void); + /// @brief Clears categories + static void clearCategories(void); }; class VersionInfo : base::StaticClass { public: |