summaryrefslogtreecommitdiff
path: root/lib/common/Logging.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/common/Logging.h')
-rw-r--r--lib/common/Logging.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/common/Logging.h b/lib/common/Logging.h
index d74ded61..7cf9d46c 100644
--- a/lib/common/Logging.h
+++ b/lib/common/Logging.h
@@ -446,6 +446,37 @@ class Logging
Logging::Remove(mpLogger);
}
};
+
+ // --------------------------------------------------------------------------
+ //
+ // Class
+ // Name: Logging::OptionParser
+ // Purpose: Process command-line options
+ // Created: 2014/04/09
+ //
+ // --------------------------------------------------------------------------
+ class OptionParser
+ {
+ public:
+ OptionParser(Log::Level InitialLevel =
+ #ifdef BOX_RELEASE_BUILD
+ Log::NOTICE
+ #else
+ Log::INFO
+ #endif
+ )
+ : mCurrentLevel(InitialLevel)
+ { }
+
+ static std::string GetOptionString();
+ int ProcessOption(signed int option);
+ static std::string GetUsageString();
+ int mCurrentLevel; // need an int to do math with
+ Log::Level GetCurrentLevel()
+ {
+ return (Log::Level) mCurrentLevel;
+ }
+ };
};
class FileLogger : public Logger