summaryrefslogtreecommitdiff
path: root/src/LogFactory.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2014-01-30 00:12:24 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2014-01-30 00:15:05 +0900
commit30e4077440e93a9e78cf55a3a1a4e295ae5e9a72 (patch)
tree46eb7a9dd27c77921ce8e1fa071d1398c13f0fb0 /src/LogFactory.cc
parentf2fa24b418f407bd94074b0988e3e5307e781bff (diff)
Add --enable-color option to enable/disable terminal color output
Diffstat (limited to 'src/LogFactory.cc')
-rw-r--r--src/LogFactory.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/LogFactory.cc b/src/LogFactory.cc
index 6773526e..6312ef20 100644
--- a/src/LogFactory.cc
+++ b/src/LogFactory.cc
@@ -48,6 +48,7 @@ std::shared_ptr<Logger> LogFactory::logger_;
bool LogFactory::consoleOutput_ = true;
Logger::LEVEL LogFactory::logLevel_ = Logger::A2_DEBUG;
Logger::LEVEL LogFactory::consoleLogLevel_ = Logger::A2_NOTICE;
+bool LogFactory::colorOutput_ = true;
void LogFactory::openLogger(const std::shared_ptr<Logger>& logger)
{
@@ -59,6 +60,7 @@ void LogFactory::openLogger(const std::shared_ptr<Logger>& logger)
logger->setLogLevel(logLevel_);
logger->setConsoleLogLevel(consoleLogLevel_);
logger->setConsoleOutput(consoleOutput_);
+ logger->setColorOutput(colorOutput_);
}
void LogFactory::adjustDependentLevels() {
@@ -154,6 +156,11 @@ void LogFactory::setConsoleLogLevel(const std::string& level)
adjustDependentLevels();
}
+void LogFactory::setColorOutput(bool enabled)
+{
+ colorOutput_ = enabled;
+}
+
void LogFactory::release() {
logger_.reset();
}