summaryrefslogtreecommitdiffstats
path: root/base/logging.cc
Commit message (Collapse)AuthorAgeFilesLines
* Changes to base/ from a combination of FreeBSD and OpenBSD patches.evan@chromium.org2009-12-291-3/+6
| | | | | | Review URL: http://codereview.chromium.org/495002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35321 0039d316-1c4b-4281-b951-d872f2087c98
* Make POSIX SIGTERM/SIGINT/SIGHUP handler async signal safe.willchan@chromium.org2009-12-081-0/+37
| | | | | | | | | | * Don't use LOG/CHECK. Replace with RAW_LOG/DCHECK (newly added to logging.h) * Don't directly post a task to the UI loop. Write to a magic pipe. Read this from a separate thread which will post to a task to the UI loop. BUG=http://crbug.com/29240 Review URL: http://codereview.chromium.org/460094 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34036 0039d316-1c4b-4281-b951-d872f2087c98
* Flush logging output.derat@chromium.org2009-12-021-11/+18
| | | | | | | | | | | It gets buffered otherwise, which is inconvenient when trying to follow what's going on in the Chrome OS window manager. TEST=compiled and ran it Review URL: http://codereview.chromium.org/459001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33520 0039d316-1c4b-4281-b951-d872f2087c98
* Integrate the base logging with Event Tracing for Windows. This allows ETW ↵siggi@chromium.org2009-11-251-0/+10
| | | | | | | | | | | to control the log level and log feature flags from outside the process, and all log messages can be transported into ETW trace sessions.As is this provides an event trace provider class thatmanages the log level on control callbacks and shunts the formatted log messages to ETW when warranted.The provider observes one feature flag, which when turned on causes it to capture and log a stack trace at the log site, which can be helpful when diagnosing errors from logs.This CL also initializes ETW logging for chrome.dll, but only if the environment variable "CHROME_ETW_LOGGING" is set. The ETW machinery may create a thread in every process registering a trace provider, and the environment variable makes this overhead optional. TEST=Unittests in this change BUG=none Review URL: http://codereview.chromium.org/413006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33066 0039d316-1c4b-4281-b951-d872f2087c98
* Add logging macros that automatically append the last system error in string ↵tschmelcher@chromium.org2009-10-091-0/+92
| | | | | | | | | | | | | form. Also add thread-safe, portable variants for strerror() and strerror_r() on POSIX so that existing error logging code that calls strerror() for something other than LOG, LOG_IF, or CHECK can be changed to use safe versions too. After this CL I will eliminate all unsafe uses of strerror() in our code. TEST=Linux: tested PLOG and DPLOG with both a valid error and invalid error on a dbg build with both the default strerror_r implementation (GNU) and the other one (POSIX) via some throw-away macro evilness, and also tested the default strerror_r again on an opt build to verify DPLOG is a no-op; Windows: tested PLOG and DPLOG with both a valid error and invalid error on a dbg build; also tested LOG_GETLASTERROR_MODULE with winhttp and ERROR_WINHTTP_CANNOT_CONNECT and verified that it prints the correct system message and that it doesn't with PLOG; also tested LOG_GETLASTERROR_MODULE with a bogus module name and verified that it prints an error that it can't find the module, and the original error; Mac: none (implicitly tested via the Linux POSIX tests); trybots for Win, Mac, and Linux 32-bit; built locally for Linux 32-bit and 64-bit and tested base_unittests and also running Chromium itself; wrote the upcoming CL that switches strerror() calls to use PLOG and verified that it builds and works for both Linux 32-bit and Linux 64-bit; lint BUG=none Review URL: http://codereview.chromium.org/265052 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28632 0039d316-1c4b-4281-b951-d872f2087c98
* Copy the relevant parts of ICU to a new file base/third_party/icu/icu_utf.*brettw@chromium.org2009-10-071-3/+3
| | | | | | | | | | | | | | so we can do basic UTF8/16/32 conversions without linking all of ICU. Change callers who used to call SysUTF8ToWide/SysWideToUTF8 in base to using these new functions. I will remove the Sys versions of these functions in a later patch. TEST=none BUG=none Review URL: http://codereview.chromium.org/243102 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28219 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 28166.ojan@chromium.org2009-10-061-195/+0
| | | | | | Review URL: http://codereview.chromium.org/242167 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28170 0039d316-1c4b-4281-b951-d872f2087c98
* Add logging macros that automatically append the last system error in string ↵tschmelcher@google.com2009-10-061-0/+195
| | | | | | | | | | form. TESTED=Linux: tested PLOG and DPLOG with both a valid error and invalid error on a dbg build with both the default strerror_r implementation (GNU) and the other one (POSIX) via some throw-away macro evilness, and also tested the default strerror_r again on an opt build to verify DPLOG is a no-op; Windows: tested PLOG and DPLOG with both a valid error and invalid error on a dbg build; also tested LOG_GETLASTERROR_MODULE with winhttp and ERROR_WINHTTP_CANNOT_CONNECT and verified that it prints the correct system message and that it doesn't with PLOG; also tested LOG_GETLASTERROR_MODULE with a bogus module name and verified that it prints an error that it can't find the module, and the original error; Mac: none (implicitly tested via the Linux POSIX tests) Review URL: http://codereview.chromium.org/255093 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28166 0039d316-1c4b-4281-b951-d872f2087c98
* Remove even the logging statement from ~LogMessage. We shouldn't be using ↵phajdan.jr@chromium.org2009-08-031-7/+6
| | | | | | | | | | | LOG macros there. TEST=none http://crbug.com/18028 Review URL: http://codereview.chromium.org/159789 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22292 0039d316-1c4b-4281-b951-d872f2087c98
* Do not abort the process if thread owning the log mutex has crashed.phajdan.jr@chromium.org2009-07-311-1/+6
| | | | | | | | | | | It makes UI tests even more flaky. However, we still log that event. TEST=none http://crbug.com/18028 Review URL: http://codereview.chromium.org/159723 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22195 0039d316-1c4b-4281-b951-d872f2087c98
* Linux: refactor zygote supportagl@chromium.org2009-06-121-18/+0
| | | | | | | | | | | | | | | | | | | http://code.google.com/p/chromium/wiki/LinuxZygote * Move Chrome specific bits out of base * Move away from the idea of reserved file descriptors (which don't really work with zygotes) * Load resources before forking renderers (means that we don't need communication between the zygote process and the renderers) * Make sure that gdb works against the browser again * Make sure that we have different ASLR between the renderers and the browser. http://codereview.chromium.org/119335 (This is a reland. First landed in r18109, reverted in r18112.) git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18291 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 18109, 18111: Windows UI tests failed.agl@chromium.org2009-06-101-0/+18
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18112 0039d316-1c4b-4281-b951-d872f2087c98
* Linux: refactor zygote supportagl@chromium.org2009-06-101-18/+0
| | | | | | | | | | | | | | | | | | http://code.google.com/p/chromium/wiki/LinuxZygote * Move Chrome specific bits out of base * Move away from the idea of reserved file descriptors (which don't really work with zygotes) * Load resources before forking renderers (means that we don't need communication between the zygote process and the renderers) * Make sure that gdb works against the browser again * Make sure that we have different ASLR between the renderers and the browser. http://codereview.chromium.org/119335 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18109 0039d316-1c4b-4281-b951-d872f2087c98
* Enable zygote manager by default.dkegel@google.com2009-06-081-1/+5
| | | | | | | | | | | | | | Fix broken recursion check. Make OpenFile warning less scary, indicate it's normal at start of ui tests. Make ui tests pass. Avoid generating extra code on Mac. BUG=11841 TEST=start the browser, then make chrome and all .pak files unreadable; or alternately, start an installed browser, and uninstall the browser while it's running. Then create a new tab and browse to two new sites. Review URL: http://codereview.chromium.org/119289 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17909 0039d316-1c4b-4281-b951-d872f2087c98
* Prototype implementation of zygotes. dkegel@google.com2009-06-061-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Limitations that need addressing still: - Doesn't forcibly terminate children that should have exited but haven't Enable with env var ENABLE_ZYGOTE_MANAGER=1. BUG=11841 TEST= start the browser, then make chrome and all .pak files unreadable; or alternately, start an installed browser, and uninstall the browser while it's running. Then create a new tab and browse to two new sites. Here's an example script to hide and unhide the .pak files (note: do not move the directory they're in, that doesn't work): #!/bin/sh chmod_all() { chmod $1 sconsbuild/Debug/chrome for path in . locales obj/chrome/app/intermediate/repack obj/global_intermediate/* themes do chmod $1 sconsbuild/Debug/$path/*.pak done } case $1 in hide) chmod_all 000 ;; show) chmod_all 755 ;; esac Review URL: http://codereview.chromium.org/115773 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17840 0039d316-1c4b-4281-b951-d872f2087c98
* Use thread-safe localtime_r instead of localtime.thestig@chromium.org2009-05-131-4/+4
| | | | | | | BUG=11588 Review URL: http://codereview.chromium.org/115272 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15922 0039d316-1c4b-4281-b951-d872f2087c98
* Print backtraces on FATAL log messages in debug mode.ajwong@chromium.org2009-04-241-2/+9
| | | | | | | | This provides basic support for looking up backtrace information on GNU libc systems and in Windows. The code is only enabled for FATAL log messages in debug mode. In a release build, it is unlikely that symbols will be available making the backtrace less useful. Review URL: http://codereview.chromium.org/62140 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14391 0039d316-1c4b-4281-b951-d872f2087c98
* Save and restore the value of GetLastError() when [D]LOG/[D]CHECK etc on ↵tommi@google.com2009-04-141-0/+9
| | | | | | | | | | 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
* First stab at Mac breakpad support.jeremy@chromium.org2009-03-261-2/+0
| | | | | | | | breakpad_mac.mm still needs some work, there's a bunch of scaffolding in there referring to a custom version of Breakpad I've got going locally. Review URL: http://codereview.chromium.org/53075 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12553 0039d316-1c4b-4281-b951-d872f2087c98
* Eliminate precarious use of const_cast<wchar*>(wstring.get())mark@chromium.org2009-03-251-6/+5
| | | | | | Review URL: http://codereview.chromium.org/42617 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12503 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a second error in the build bustage, still about constness.maruel@chromium.org2009-03-031-1/+1
| | | | | | | TBR=deanm Review URL: http://codereview.chromium.org/39015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10793 0039d316-1c4b-4281-b951-d872f2087c98
* NO CODE CHANGE (except one global std::wstring changed to const wchar_t* ↵maruel@chromium.org2009-03-031-7/+12
| | | | | | | | | | | const per style compliance). Preliminary work to enforce new PRESUBMIT.py rules: - <=80 cols - no trailing whitespaces - svn:eol-style=LF git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10791 0039d316-1c4b-4281-b951-d872f2087c98
* Change the behavior of --enable-dcheck in releasehuanr@chromium.org2009-02-121-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | build from crashing to logging the failure and continuing. In addition, - In interactive mode, we will display a message box so the user can either click OK and continue or attach a debugger. - If Chrome is running in test environment, it has the option to overide the default behavior and suppress the error dialog. To support this, a new severity level ERROR_REPORT is added. In addition, DFATAL is now mapped to ERROR_REPORT instead of ERROR. The only usage of DFATAL is in ssl_client_socket_nss.cc. Add wtc for code review. Review URL: http://codereview.chromium.org/21216 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9633 0039d316-1c4b-4281-b951-d872f2087c98
* Make CommandLine into a normal object, with some statics for getting at the ↵evan@chromium.org2009-01-211-1/+2
| | | | | | | | | | | current process's command line. One explicit goal of this change is to *not* deal with the string/wstring issues at the API on POSIX; the functions are the same as before, which means they remain as broken as before. (I did try to fix the internals, though, so migrating the callers is now possible by adding platform-appropriate hooks.) Review URL: http://codereview.chromium.org/18248 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8347 0039d316-1c4b-4281-b951-d872f2087c98
* Enabled WebFrameTest, refactored some test shell functions.estade@chromium.org2008-11-061-9/+15
| | | | | | Review URL: http://codereview.chromium.org/9652 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4916 0039d316-1c4b-4281-b951-d872f2087c98
* Make assertions not display message boxes to the end user. This is causingbrettw@google.com2008-11-061-3/+7
| | | | | | | | | an infinite recursion of assertion messages during a painting error. BUG=4139 Review URL: http://codereview.chromium.org/9608 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4844 0039d316-1c4b-4281-b951-d872f2087c98
* revert 9391estade@chromium.org2008-11-051-7/+34
| | | | | | Review URL: http://codereview.chromium.org/9607 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4837 0039d316-1c4b-4281-b951-d872f2087c98
* Enabled WebFrameTest, refactored some test shell functions.estade@chromium.org2008-11-051-34/+7
| | | | | | Review URL: http://codereview.chromium.org/9391 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4834 0039d316-1c4b-4281-b951-d872f2087c98
* Another attempt at enabling stderr logging for ERROR and FATAL logs. This ↵erikkay@google.com2008-08-261-2/+2
| | | | | | | | | will break a few layout tests. (I'll add them to the fixable list shortly) BUG=1343647 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1385 0039d316-1c4b-4281-b951-d872f2087c98
* An earlier change I made sent all logging output to stderr. The webkit ↵erikkay@google.com2008-08-251-2/+11
| | | | | | | | | | | layout tests use stdout and stderr to diff against a known baseline, so this breaks some tests. For now, move the fprintf into the #else. This still leaves Windows and Mac in a state where they won't be able to pass layout tests, until the layout tests can be changed to initialize logging and set the log level to something less verbose. BUG=1343647 TBR=brettw git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1353 0039d316-1c4b-4281-b951-d872f2087c98
* When we're only outputting to a log file, above a certain log level, we ↵erikkay@google.com2008-08-251-2/+10
| | | | | | should still output to stderr so that we can better detect and diagnose problems with unit tests, especially on the buildbots. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1323 0039d316-1c4b-4281-b951-d872f2087c98
* Move NOTIMPLEMENTED() macro from "base/notimplemented.h" into "base/logging.h".ericroman@google.com2008-08-251-1/+0
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1300 0039d316-1c4b-4281-b951-d872f2087c98
* Use a more compact license header in source files.license.bot2008-08-241-28/+4
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1287 0039d316-1c4b-4281-b951-d872f2087c98
* Back out r1223, we'll just look at the logs on the buildbots for now. It ↵mmentovai@google.com2008-08-221-1/+1
| | | | | | would be nice to send only ERROR warnings to stderr to avoid the noise. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1225 0039d316-1c4b-4281-b951-d872f2087c98
* Send log output to stderr on Windows when uninitializedmmentovai@google.com2008-08-221-1/+1
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1223 0039d316-1c4b-4281-b951-d872f2087c98
* Send log messages to stderr when uninitialized on POSIX platforms.mmentovai@google.com2008-08-191-15/+28
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1071 0039d316-1c4b-4281-b951-d872f2087c98
* Define MessagePumpDefault and use it to implement MessageLoop on non-Windowsdarin@google.com2008-08-191-4/+4
| | | | | | | | | | | | | | | | | platforms. This is actually just a first-step toward the real fix which is to use MessagePumpDefault on all platforms on non-UI and non-IO threads. This CL also fixes some GCC compilation errors. I renamed MessageLoopOwnable to TaskBase, which seems more appropriate since a MessageLoopOwnable has a next Task pointer and clearly is only meaningful in the context of Task. (I wonder why it is even a separate class, but that is another issue.) I had to make the next_task / set_next_task methods public since they are used by an inner class of MessageLoop. Perhaps those inner classes should be made into top-level classes, but that seemed like too much to change at this time. R=jar,mmentovai git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1045 0039d316-1c4b-4281-b951-d872f2087c98
* Move the system string conversion functions from std::string to StringPiece. ↵deanm@google.com2008-08-191-0/+1
| | | | | | We often work with char* in the system layer, so this should save extra copying. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1027 0039d316-1c4b-4281-b951-d872f2087c98
* To pass string_util_unittest, we need the ICU data file. To get the ICU ↵evanm@google.com2008-08-151-0/+4
| | | | | | data file, we need some of PathService, which brings along with it a bunch of other needed functions. So here are a bunch of stubs, along with another file's worth of passing tests. (Based on a patch from Dean.) git-svn-id: svn://svn.chromium.org/chrome/trunk/src@921 0039d316-1c4b-4281-b951-d872f2087c98
* Make debug_util cross platform, adding BeingDebugged and BreakDebugger. Linuxdeanm@google.com2008-08-131-17/+7
| | | | | | | supported added, and Mac OSX left as a todo for the mac team. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@785 0039d316-1c4b-4281-b951-d872f2087c98
* Remove all the C-style string munging, making this easier to port to Linux.evanm@google.com2008-08-111-55/+42
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@674 0039d316-1c4b-4281-b951-d872f2087c98
* Replace a todo with NOTIMPLEMENTED().ericroman@google.com2008-08-111-2/+3
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@663 0039d316-1c4b-4281-b951-d872f2087c98
* fix recursionpinkerton@google.com2008-08-081-2/+2
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@562 0039d316-1c4b-4281-b951-d872f2087c98
* Logging cleanup for mac and linuxpinkerton@google.com2008-08-081-15/+164
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@561 0039d316-1c4b-4281-b951-d872f2087c98
* This is the addition of the system-dependent string conversions. This is ↵brettw@google.com2008-08-071-23/+8
| | | | | | just the new code and changing logging to use it. I will change other things to use this and delete the code in string_util in a subsequent pass. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@479 0039d316-1c4b-4281-b951-d872f2087c98
* Revert change 430 because it breaks the build.nsylvain@google.com2008-08-061-166/+25
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@437 0039d316-1c4b-4281-b951-d872f2087c98
* Changes for POSIX support. Yay for ifdefs!pinkerton@google.com2008-08-061-25/+166
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@430 0039d316-1c4b-4281-b951-d872f2087c98
* Add base to the repository.initial.commit2008-07-261-0/+396
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8 0039d316-1c4b-4281-b951-d872f2087c98