diff options
author | tommi@google.com <tommi@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-14 16:52:11 +0000 |
---|---|---|
committer | tommi@google.com <tommi@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-14 16:52:11 +0000 |
commit | 3f85caafb239d5725ec85af9b8ce9f1b1de15770 (patch) | |
tree | dc5bdda66d8c915a1ae7b230c35130ab338ed703 /base/logging.cc | |
parent | d92224288027cefbbd197bd9eed9080110aa9222 (diff) | |
download | chromium_src-3f85caafb239d5725ec85af9b8ce9f1b1de15770.zip chromium_src-3f85caafb239d5725ec85af9b8ce9f1b1de15770.tar.gz chromium_src-3f85caafb239d5725ec85af9b8ce9f1b1de15770.tar.bz2 |
Save and restore the value of GetLastError() when [D]LOG/[D]CHECK etc on Windows.
Also for log levels higher than INFO, the value of GLE is tagged onto the log message.
Review URL: http://codereview.chromium.org/73010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13667 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/logging.cc')
-rw-r--r-- | base/logging.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/base/logging.cc b/base/logging.cc index 41a0933..961ea6c 100644 --- a/base/logging.cc +++ b/base/logging.cc @@ -342,6 +342,15 @@ void DisplayDebugMessage(const std::string& str) { #endif } +#if defined(OS_WIN) +LogMessage::SaveLastError::SaveLastError() : last_error_(::GetLastError()) { +} + +LogMessage::SaveLastError::~SaveLastError() { + ::SetLastError(last_error_); +} +#endif // defined(OS_WIN) + LogMessage::LogMessage(const char* file, int line, LogSeverity severity, int ctr) : severity_(severity) { |