diff options
author | Chris Wilson <chris+github@qwirx.com> | 2008-02-22 00:43:16 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2008-02-22 00:43:16 +0000 |
commit | 1a948d1c2b1eb2d8b868e81648fb19d359b71a8e (patch) | |
tree | 7adccf33ccd43493e16df2773b447ee7285abd69 /lib/common | |
parent | 77a70367258e4eb99c455026e79156c680aa8909 (diff) |
Disable -P option and showing PID in Logging on Windows.
Diffstat (limited to 'lib/common')
-rw-r--r-- | lib/common/Logging.cpp | 8 | ||||
-rw-r--r-- | lib/common/Logging.h | 4 |
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/common/Logging.cpp b/lib/common/Logging.cpp index 7da7409d..9b9721a8 100644 --- a/lib/common/Logging.cpp +++ b/lib/common/Logging.cpp @@ -182,7 +182,9 @@ Logger::~Logger() bool Console::sShowTime = false; bool Console::sShowTimeMicros = false; bool Console::sShowTag = false; +#ifndef WIN32 bool Console::sShowPID = false; +#endif std::string Console::sTag; void Console::SetTag(const std::string& rTag) @@ -201,10 +203,12 @@ void Console::SetShowTimeMicros(bool enabled) sShowTimeMicros = enabled; } +#ifndef WIN32 void Console::SetShowPID(bool enabled) { sShowPID = enabled; } +#endif bool Console::Log(Log::Level level, const std::string& rFile, int line, std::string& rMessage) @@ -258,19 +262,23 @@ bool Console::Log(Log::Level level, const std::string& rFile, if (sShowTag) { + #ifndef WIN32 if (sShowPID) { buf << "[" << sTag << " " << getpid() << "] "; } else + #endif { buf << "[" << sTag << "] "; } } + #ifndef WIN32 else if (sShowPID) { buf << "[" << getpid() << "] "; } + #endif if (level <= Log::FATAL) { diff --git a/lib/common/Logging.h b/lib/common/Logging.h index f26fd217..21c23a7e 100644 --- a/lib/common/Logging.h +++ b/lib/common/Logging.h @@ -121,7 +121,9 @@ class Console : public Logger static bool sShowTimeMicros; static bool sShowTag; static std::string sTag; + #ifndef WIN32 static bool sShowPID; + #endif public: virtual bool Log(Log::Level level, const std::string& rFile, @@ -132,7 +134,9 @@ class Console : public Logger static void SetTag(const std::string& rTag); static void SetShowTime(bool enabled); static void SetShowTimeMicros(bool enabled); + #ifndef WIN32 static void SetShowPID(bool enabled); + #endif }; // -------------------------------------------------------------------------- |