History log of /system/core/base/logging.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
9dddd137c72a989b414c1bc8e928fb67ee46fac3 04-Feb-2016 Dan Willemsen <dwillemsen@google.com> Fix windows 64-bit builds

pid_t is 64-bit in 64-bit mingw, but the windows process/thread
functions return a DWORD(uint32_t). Instead of promoting to a pid_t and
fixing the format strings, just use a uint32_t to store the values.

android_thread_id also cannot be a 64-bit pointer, so for windows just
force it to be a uint32_t.

libutils/ProcessCallStack only works under Linux, since it makes heavy
use of /proc. Don't compile it under Windows or Darwin.

Bug: 26957718

(cherry picked from commit 86cf941c480de8d5693a24d3feb45574f5c89a86)

Change-Id: I8d39d1951fea1b3011caf585c983e1da7959f7c0
/system/core/base/logging.cpp
4f71319df011d796a60a43fc1bc68e16fbf7d321 05-Dec-2015 Elliott Hughes <enh@google.com> Track rename of base/ to android-base/.

Change-Id: Idf9444fece4aa89c93e15640de59a91f6e758ccf
/system/core/base/logging.cpp
26f2e1fd4ff02cb8a3927c86a90656269ebcb412 12-Nov-2015 Josh Gao <jmgao@google.com> Merge changes Ic124ecb9,I94de55d2

* changes:
libbase: remove exit-time destructors.
adb: remove exit-time destructors.
7df6b5fc79a0f4521d171280cd431640ac567d27 12-Nov-2015 Josh Gao <jmgao@google.com> libbase: remove exit-time destructors.

Removed for the same reason as the adb exit-time destructors.

Bug: http://b/23384853
Change-Id: Ic124ecb9df132b850a3855e207baffec926dde29
/system/core/base/logging.cpp
c1fd492ac5c14a42acfbbd9b47ed178fbf1378d3 11-Nov-2015 Elliott Hughes <enh@google.com> Revert "Revert "adb/base: fix adb push of Unicode filenames on Win32""

This reverts commit cc8cd59456ca485a51cd6fd388c8bcb1af4a8f9b.

With the dependency on libcutils (for gettid for non-bionic) removed,
this no longer breaks the build.

Change-Id: I645bd6876e2502ddc1535b69af1e645c0df9d178
/system/core/base/logging.cpp
363af568b8491af1a4256b09b04cfa8a0606d8cc 08-Nov-2015 Spencer Low <CompareAndSwap@gmail.com> adb/base: minor compiler portability improvements

I've been using these changes to compile with Visual Studio.

- GetFileBasename(): __FILE__ uses \ with Visual Studio.

- adb_trace.cpp: Apparently VS needs an ampersand before the function name.

- "expr1 ? : expr2" is a GCC extension.

- <algorithm> contains std::min().

- seekdir can't always be #define'd because some headers have members
named seekdir.

- adb_utils.cpp: Not really a compiler issue, just a random fix:
0x7F/DEL is not printable.

Change-Id: I0dfb634f1ba4ccbc0d1b9f71b00e838fbebb3b41
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
/system/core/base/logging.cpp
765ae6bcfc62148de629f68315fdf8cd1bc35342 18-Sep-2015 Spencer Low <CompareAndSwap@gmail.com> base logging: fix errno restoring, severity conditionality, dangling ifs

Fix LOG() to properly save and restore errno. Test this properly.

Only do logging if severity is >= the minimum.

Fix dangling if statements in CHECK(), CHECK_STR{EQ,NE}(). Test this
properly.

Fix base logging tests on Windows. All libbase_tests now pass on
Windows.

Change place to lock, so the lock can protect logging of all data in
LogMessage.

Change-Id: I7ff531c67ae10a99ef0a2bbfe279aa77282d5ae9
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
/system/core/base/logging.cpp
bdab59a8613c732df5d746328ff2268be8da13ab 12-Aug-2015 Spencer Low <CompareAndSwap@gmail.com> libbase: logging fixes

Win32:

- getprogname(): call basename() which is available in mingw's crt.
Don't potentially go recursive with DCHECK_GT().

- Use Win32 critical section instead of mutex.

Other:

- Change log_characters check to compile-time.

- Fix code that gets the basename of __FILE__. The previous code was not
setting _file, so it didn't work.

- Save and restore errno for LOG calls. Inspired by similar Chromium code.

Change-Id: Ie7bb700918be726fa81d60177d1894d2daeff296
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
/system/core/base/logging.cpp
ac3f7d9a78f9024563cc47f62206c6e3475778dd 20-May-2015 Spencer Low <CompareAndSwap@gmail.com> adb / libbase: clean up NOGDI and evil ERROR macro

Instead of defining and undefining NOGDI:

1. Always #include "base/logging.h" after #include <windows.h>.
Unfortunately, I could not find an easy way to give the user a
warning/error if they include in the wrong order.

2. base/logging.h does #undef ERROR to undefine the evil ERROR macro
that is from another era and probably a bad idea to begin with.

Change-Id: I995d89620611e849af9d7ec47eb55fc0512377f2
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
/system/core/base/logging.cpp
ea41c213bea5dcc04dea39a2903dc7f301bd5184 05-May-2015 Dan Albert <danalbert@google.com> Add additional shielding against the ERROR macro.

Including the logging header with ERROR defined will always be a
problem, so check for it explicitly.

Move the NOGDI define from logging.cpp to logging.h since the standard
library headers might be including windows.h, pulling in ERROR.

Change-Id: Ib426973d2f1840710c0bf0e0cfb2420d0d322e27
/system/core/base/logging.cpp
5c19040b06b5bb61731e24ea6777c237dc23145d 29-Apr-2015 Dan Albert <danalbert@google.com> Support base::logging on Windows.

libc++ doesn't support std::mutex and friends for Windows yet, so we
just use a compatibility wrapper for now.

Change-Id: I2413d4c089e7d0fb232444043c6b772153035dab
/system/core/base/logging.cpp
7a87d0597476c4d87b71d46b8b8af756dc736cb3 03-Apr-2015 Dan Albert <danalbert@google.com> Cleanup base/logging.

Some of this code was unused, most didn't need to be exposed, and we
can just use basename(3).

Also use a better default program name than "unknown".

Change-Id: I62d990f64e4fd0c16aa4b7e907dd06e4f26ddcdd
/system/core/base/logging.cpp
b547c85b5b9d7fc565e47a5d0c734c3a66af242a 27-Mar-2015 Dan Albert <danalbert@google.com> Support arbitrary loggers.

While the defaults (logd or stderr) make sense for most use cases,
there are places that can only log to the kernel, or need to log to a
file, etc.

Allow the user to pass in an arbitrary logging object, and provide
LogdLogger and StderrLogger as defaults.

Change-Id: I62368acc795ff313242bb205d65017404bf64e88
/system/core/base/logging.cpp
0c055863ebb57c3446897e89c2c39a67442c1be4 27-Mar-2015 Dan Albert <danalbert@google.com> Support logging to other log buffers.

LOGTO(dest, severity) and PLOGTO(dest, severity) log to other log
buffers. For example, `LOGTO(SYSTEM, FATAL) << "Foobar";`.

Change-Id: Id1ca1c8fdae72d69b73945ae9b006525d0be1582
/system/core/base/logging.cpp
0cc351b1a7e37c61821a8601aa8dfc713a0d584a 03-Apr-2015 Dan Albert <danalbert@google.com> Remove LogMessage::LogLineLowStack.

This was ported over from ART, but even they only use it in a single
place.

Change-Id: Ia34dc54b56c764ede79b2957bf3dc8df0f1323ee
/system/core/base/logging.cpp
4b3f533be9a29bc44fae6a94cdbbdc8eb1adaa3c 27-Mar-2015 Dan Albert <danalbert@google.com> Include what we use.

Change-Id: If510431d3d445de94f781b4fdec2e1b445f7c294
/system/core/base/logging.cpp
7dfb61dcdca8ee597f23b9acc365fb140b353fff 20-Mar-2015 Dan Albert <danalbert@google.com> Move gettid() into libcutils.

Change-Id: Ic8a15036833e6d129b7998d954b804be391de399
/system/core/base/logging.cpp
47328c96d91ca71b57b8976df2df1fe51579a955 19-Mar-2015 Dan Albert <danalbert@google.com> Update string Split API.

Return a new vector rather than appending to the parameter.

Delimiters are also a string rather than a character. Split on any
character in the string.

Change-Id: I039b332ace5578590df9e7ca0e8fa3db28db30a3
/system/core/base/logging.cpp
58310b49fc8a7a713b922319a849a419858db79e 14-Mar-2015 Dan Albert <danalbert@google.com> Add google3 style logging to libbase.

ART already had a flavor of this, but it was specialized for their use
case a bit.

Note that the logging.* tests are currently disabled for the device
because there is no good way to capture the output of liblog. We can
make something that will execute logcat and then then scan the output,
but that's messy. Since we know it at least works on the host, we can
add better device tests later.

Change-Id: I47acd87a3312c0a5285b03f9c8dadef0c669f06a
/system/core/base/logging.cpp