Commit graph

4 commits

Author SHA1 Message Date
Mark Salyzyn
4d99c986d9 liblog: add LOGGER_STDERR frontend
Standalone, this logger provides no end-to-end capability.  Only
provides a writer, no reader transport.  All output goes, logcat-like,
into the stderr stream.  Output can be adjusted with environment
variables ANDROID_PRINTF_LOG and ANDROID_LOG_TAGS.

liblog_*.__android_log_bswrite_and_print___max print fails if a string
member is truncated with "Binary log entry conversion failed" and -1.
We expose the truncated content in the tests and in LOGGER_STDERR.

The purpose of this transport selection is for command-line tools,
providing a means to shunt the logs to be mixed in with the tool's
error stream.

Test: gTest liblog-unit-tests
Bug: 27405083
Change-Id: If344b6e3e67df2dc86ce317cfad8af8e857727b7
2017-03-08 07:17:31 -08:00
Mark Salyzyn
7100288532 liblog: add local_logger
- Create the local-only logger module
- Add LOGGER_LOCAL flag to android_set_log_frontend to enable
- Permit log reader for host compilation

android_set_log_frontend(LOGGER_LOCAL) will result in logs going
into application local memory.  logcat can not retrieve the data,
the user must utilize the log reading interface directly to
acquire their own logs.  Some local logger tests dropped as they
represent testing other liblog facilities.  Other local logger
tests dropped because we make the conscious decision to not
support LOG_ID_SECURITY logging.

ToDo: Some local logger tests dropped because of missing
      functionality associated with blocking reader.

Test: gTest libcutils-tests, logd-unit-tests, liblog-unit-tests,
      logcat-unit-tests, liblog-benchmarks and CtsLiblogTestCases_list
Bug: 27405083
Change-Id: Ia23b932af9e05756eaa60bab9139876b14faf72d
2017-02-08 15:07:06 -08:00
Mark Salyzyn
96432fc665 liblog: add __android_log_config_*_close()
Add __android_log_config_read_close() and
__android_log_config_write_close().  Fortify the list macros
to detect for list corruption, looking for entries pointing
to themselves, deleted entries in list.

Test: gTest liblog-unit-tests
Bug: 27405083
Change-Id: I33e8a0cae7e202f1989ddd7c2a96752b44c8e746
2017-02-08 13:37:44 -08:00
Mark Salyzyn
facf94c74a liblog: split out transports into separate files
(cherry pick from commit 018a96d03f)

Create config_logger, logger and logger_read to house the log
interfaces. Add fake_logger, logd_logger and pmsg_logger to
house the write and read transports. Allows for an easier and
direct path to add new transports to the library.

SideEffects: None, logger benchmark performance unaffected

Bug: 27176738
Bug: 27405083
Change-Id: I01b38637334a5242905c8c89f6ab0a92e2540008
2016-03-22 14:06:00 -07:00