Commit graph

18 commits

Author SHA1 Message Date
Andreas Gampe
1f742864fa Liblog: Remove unused function
For build-system CFLAGS clean-up, remove unused function.

Change-Id: I8c28c4bbbadaea6a5b32483e9e220794967bdd4e
2014-11-24 10:36:55 -08:00
Yabin Cui
8a98535bcb kill HAVE_LOCALTIME_R
Bug: 18361583
Change-Id: Icdc745a5204bba26c6438d16ed38ec791e136163
2014-11-13 10:11:23 -08:00
Pierre Zurek
ead88fca6e liblog: logcat: colored output.
This patch adds a new '-v color' option to logcat so that the output is
colored similar to the ones in DDMS. Simply type "adb logcat -v color"
to use it. Works well with bash in gnome-terminal. NO GUARANTEE IT WILL
WORK ON A NON xterm STYLE TERMINAL.

Signed-off-by: Michael Zimmermann <sigmaepsilon92@gmail.com>
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Change-Id: I9189c5f27fed991579edbcbc6834536eb8112152
2014-09-11 19:04:17 -07:00
Mark Salyzyn
a04464adaf liblog: set -Werror
- Deal with some -Wunused issues
- Cleanup UNUSED to __unused transition

Change-Id: Icd33808d4c974625f4fd0a126a90a2b4c90c8314
2014-05-07 16:56:21 -07:00
Mark Salyzyn
5045f57525 liblog: logcat: Move library print test into gTest
Change-Id: Icd33808d4c974625f4fd0a126a90a2b4c90c8315
2014-05-02 14:16:00 -07:00
Mark Salyzyn
40b21558e5 liblog: support struct logger_event_v2 format
(cherry picked from commit c176e14ce3)

Change-Id: I34c96adffab3478dae8f5a2597a840caad5092cc
2014-01-27 15:21:29 -08:00
Mark Salyzyn
cf4aa030ce liblog: whitespace cleanup
- change cutils to liblog directory path
- change tabs to spaces

(cherry picked from commit c1215c0b46)

Change-Id: I7d9db1e2b817ba0ec9a224340c5c7535a2387fd5
2014-01-27 15:08:42 -08:00
Colin Cross
9227bd3855 Move liblog headers to system/core/include/log
Move the liblog headers to log/ instead of cutils/ to complete
the separation of libcutils and liblog.  cutils/log.h still
exists and includes log/log.h in order to support the many existing
modules that use cutils/log.h.

Change-Id: I2758c9f4aedcb809ca7ba8383d0f55041dd44345
2013-07-24 12:32:39 -07:00
Andrew Hsieh
d2c8f52189 Fixed two 64-bit porting issues; Make pid/tid type consistent
1. In printf, use "%zu" for variable of type size_t
2. Print tid in %5d
3. Make type of pid/tid in AndroidLogEntry and logger_entry consistent

Change-Id: I3e3d9536ee58823f349a4734ae093d30eabe1bfe
2012-02-29 17:00:46 -08:00
Jeff Sharkey
a820a0e587 Gracefully handle truncated log messages.
Bug: 5522726
Change-Id: I8637c7da854ec1ecb321632c45ee9bc2edc94a67
2011-10-26 18:59:42 -07:00
Nick Kralevich
e1ede1530f liblog: do better checks of log messages.
Testing:

The following test cases all passed and generated log entries:

 # echo -n '\03foo\0bar\0' > /dev/log/main
 # echo -n '\03\0bar\0' > /dev/log/main
 # echo -n '\03\0a\0' > /dev/log/main

The following entries were successfully processed by
logcat but produced no log entries:

 # echo -n '\03\0\0' > /dev/log/main
 # echo -n '\03a\0\0' > /dev/log/main
 # echo -n '\03b\0\0' > /dev/log/main

Also tested the pathological error condition:

 cat /dev/urandom > /dev/log/main

which produced many "+++ LOG: malformed log entry" errors.

Bug: 5478600
Change-Id: I53bc79507242dcfc14445746c29edf47be0a90b4
2011-10-18 15:37:15 -07:00
Nick Kralevich
63f4a84104 liblog: ensure that the message length is consistent
When parsing log entries which may have embedded \0s, it's
possible for entry->messageLen to not be the actual
length of the string in entry->message.  Detect this condition.

Bug: 5417417
Change-Id: I712cac7696af7831e24765b5a1b345d6ff5fb407
2011-10-17 10:47:04 -07:00
Kenny Root
4bf3c02e02 Add checking for log entry format
The log tag may be zero length if corrupted, so check for this
condition.

Change-Id: I7616226dabe78a85859b0ab53aca08f734dbdd84
2011-10-03 14:14:41 -07:00
The Android Open Source Project
7df6349a63 merge from open-source master
Change-Id: I698b3c16bdef8751cc857b00f815cb2f95465431
2010-03-08 17:14:43 -08:00
Joe Onorato
e2bf2ea4d2 Make logcat print both the main and system buffers by default. Make SLOGx macros work. 2010-03-01 13:03:19 -08:00
Keith Preston
b45b5c9f22 Fix Heap Corruption from too long of a TAG
snprintf has a weird return value.   It returns what would have been written given a large enough buffer.
In the case that the prefix is longer then our buffer(128), it messes up the calculations below possibly causing heap corruption.
To avoid this we double check and set the length at the maximum (size minus null byte
2010-02-18 15:33:28 -06:00
Alexey Tarasov
abb9638e36 1. added macro definitions to AndroidConfig.h
2. removed unnecessary include of <alloca.h>
2008-11-07 11:44:22 +10:00
The Android Open Source Project
4f6e8d7a00 Initial Contribution 2008-10-21 07:00:00 -07:00