Commit graph

10 commits

Author SHA1 Message Date
Bernie Innocenti
804e7d8c4f Fix clang-tidy warnings in log_time.h
- Zero initialize log_time instances by default
 - Disable implicit conversions by making constructors explicit
 - Explicitly initialize to EPOCH in most places
 - Change sniffTime() to avoid in-place modification of a log_time

I stopped here, but we could consider following up with a more invasive
change to make log_time instances immutable and perhaps also remove the
default constructor to force explicit initialization to EPOCH.

Test: atest libbase_test netd_unit_test
Change-Id: I67e716ef74adaaf40ab2c6e2e0dddb8d309bc7ca
2019-01-17 14:45:19 +09:00
Mark Salyzyn
2ed51d708e liblog: specify clang format
Switch coding style to match

SideEffects: None
Test: compile
Bug: 27405083
Change-Id: Id426d5c5e3b18f2ceec22b31bbc9781aabf6bcca
2017-03-09 09:36:19 -08:00
Mark Salyzyn
aeaaf81c2c liblog: logd: logcat: Split out log/logger.h into public and private.
log/logger.h pieces moved into log/log.h.  Correct for some
minor Android Coding standards.

Test: gTests liblog-unit-tests, logd-unit-tests and logcat-unit-tests
Bug: 19235719
Bug: 26552300
Bug: 31289077
Bug: 31456426
Change-Id: I0a19fd8788eec20a582e72e4c62c04534bdb1b9a
2016-10-24 11:12:49 -07:00
Mark Salyzyn
004cd3c55d liblog: logd: logcat: deprecate log/log_read.h
Always used in combination with log/logger.h except in log_time.cpp,
and not used externally.  As a result liblog has to support stl, a
small price to pay since goal is to convert liblog to C++ internally.

Test: compile
Bug: 31456426
Bug: 26552300
Bug: 31289077
Change-Id: I72828ec807d0a2c8e40bbdebd7a69f147a7ca5a9
2016-09-30 12:47:05 -07: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
Mark Salyzyn
6d753faaf8 liblog: audit declare LIBLOG_ABI_PUBLIC
(cherry pick from commit be1d3c21b5)

- replace <sys/cdefs.h> with local "log_cdefs.h" which
  fortifies and expands definitions, adding LIBLOG_ABI_PUBLIC,
  LIBLOG_HIDDEN, LIBLOG_ABI_PRIVATE and LIBLOG_WEAK.
- clearly tag each interface as LIBLOG_ABI_PUBLIC, LIBLOG_HIDDEN,
  LIBLOG_ABI_PRIVATE, LIBLOG_WEAK or static depending on scope
- Add -fvisibility=hidden to ensure nothing else leaks
- some code standard adjustments

Bug: 27566046
Change-Id: Ic14033c4e6d833d973beb035ddc1c6134fb35a3f
2016-03-10 14:44:27 -08:00
Mark Salyzyn
f3555d9427 logcat: -f flag to continue
On startup, check the current logging content, then grab logs from
that time forward rather than restarting from the beginning. Add
support for reading tail time down to the nano-second.

Bonus, permits us to create a logcatd logpersist daemon

Bug: 19608716
Change-Id: Iaab58de4c02b7f97c69de12cf954fedc2163059e
2015-06-02 14:56:44 -07:00
Mark Salyzyn
decd92945f liblog: Add log_time += operator
Change-Id: I1d2987b6cb333fc344d4fee1b7bb25f32a4143c6
2015-01-05 16:27:54 +00:00
Yabin Cui
8a98535bcb kill HAVE_LOCALTIME_R
Bug: 18361583
Change-Id: Icdc745a5204bba26c6438d16ed38ec791e136163
2014-11-13 10:11:23 -08:00
Mark Salyzyn
fa3716b250 logd: liblog: logcat: Arbitrary time to tail
Change-Id: I10e8d92c933e31ee11e78d2d1114261a30c4be0e
2014-03-14 10:23:51 -07:00