Commit graph

8 commits

Author SHA1 Message Date
Elliott Hughes
8e9aeb9053 Move libcutils source to C++.
Just the minimial changes to get this to actually build, because otherwise
we always bog down trying to rewrite everything (when the real answer
is usually "stop using libcutils, it's awful").

This doesn't move a handful of files: two are basically just BSD libc
source, a couple have outstanding code reviews, and one can be deleted
(but I'll do that in a separate change).

I'm also skipping the presubmit hooks because otherwise clang-format
wants to reformat everything. I'll follow up with that...

Bug: N/A
Test: builds
Change-Id: I06403f465b67c8e493bad466dd76b1151eed5993
2017-11-10 13:18:10 -08:00
Elliott Hughes
e04c3b0533 Remove unused klog_get_level.
Every little helps...

Bug: N/A
Test: builds
Change-Id: Ibcac5cda1619420c95903211ed0b96af81351f9e
2017-01-13 18:14:12 -08:00
Wei Wang
677ba31db2 libcutils: change klog_level to KLOG_INFO_LEVEL
Some of Android componets e.g. init have migrated to use base/logging to get rid
of klog utilities. However, without explicit initilization, the default
klog_level is set to 3 which masks the logwrap output.
This patch sets default klog_level to KLOG_INFO_LEVEL to make
android_fork_execvp_ext log available.

Bug: 34256270
Test: manual
Change-Id: Ibe74707a92c954053cd0e6828a984fbd72b4acae
2017-01-12 22:18:46 -08:00
Mark Salyzyn
52bd37e633 libcutils: move cutils/files.h to cutils/android_get_control_file.h
files.[h|cpp] is bound to be abused with junk, replace with
android_get_control_file.[h|cpp]. Plus some sundry cleanup.

Test: gTest libcutils-tests, logd-unit-tests, liblog-unit-tests,
      logcat-unit-tests and init_tests
Bug: 32450474
Change-Id: Ibd4a7aa4624ea19a43d1f98a3c71ac37805d36b5
2016-11-16 15:56:56 -08:00
Mark Salyzyn
c377843258 libcutils: klog inherit android_get_control_file("/dev/kmsg")
If the file descriptor is in the environment, use it.

Test: compile
Bug: 32450474
Change-Id: Id208b11b727a44dc861a141130a644d7d8009c5f
2016-11-03 13:34:27 -07:00
Elliott Hughes
35f5d04620 Fix early init logging.
Remove the /dev/__kmsg__ workarounds (which can then be removed
from sepolicy), and fix confusion in the translation between
android-base logging and kernel logging priorities (in particular,
where 'notice' comes in the hierarchy).

Bug: http://b/30317429
Change-Id: I6eaf9919904b6b55bc402c20bf1a4ae269014bc7
Test: adb shell dmesg | grep init
2016-07-26 09:32:33 -07:00
Elliott Hughes
489e3fbaa0 Remove no-op klog_init.
Change-Id: I467edad1d004ac16647f4aa1f0eead04e808efa0
2016-07-19 11:45:36 -07:00
Elliott Hughes
171a829c39 Make klog_fd thread-safe and make klog_init a no-op.
I'll come back and remove klog_init when I've removed other calls to it.

Change-Id: Iad7fd26d853b4ddc54e9abd44516b6f138cbbfcb
Test: booted N9, looked at "adb shell dmesg" output.
2016-06-29 16:16:41 -07:00
Renamed from libcutils/klog.c (Browse further)