summaryrefslogtreecommitdiffstats
path: root/liblog/logd_write.c
diff options
context:
space:
mode:
authorWink Saville <wink@google.com>2012-11-28 12:20:19 -0800
committerWink Saville <wink@google.com>2012-12-06 10:28:34 -0800
commit3761e963b30cfc0c2dbcbe69906d689c976b9f2e (patch)
treeca1a4295dbdbdd617d02ea99bfceb8b3f27d4934 /liblog/logd_write.c
parent777991d9399f1268d27c72a03d56c1a36068a57f (diff)
downloadsystem_core-3761e963b30cfc0c2dbcbe69906d689c976b9f2e.tar.gz
system_core-3761e963b30cfc0c2dbcbe69906d689c976b9f2e.tar.bz2
system_core-3761e963b30cfc0c2dbcbe69906d689c976b9f2e.zip
Use Rlog instead of Log
Changing __android_log_write so the tag warns users relying on the tag to direct log output to the radio buffer to instead use Rlog or RLOG. Change-Id: I04b7bb5e620c1ab22b9b495382a252b539947e28
Diffstat (limited to 'liblog/logd_write.c')
-rw-r--r--liblog/logd_write.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/liblog/logd_write.c b/liblog/logd_write.c
index b91de523b..d812abce9 100644
--- a/liblog/logd_write.c
+++ b/liblog/logd_write.c
@@ -134,6 +134,7 @@ int __android_log_write(int prio, const char *tag, const char *msg)
{
struct iovec vec[3];
log_id_t log_id = LOG_ID_MAIN;
+ char tmp_tag[32];
if (!tag)
tag = "";
@@ -147,8 +148,12 @@ int __android_log_write(int prio, const char *tag, const char *msg)
!strcmp(tag, "STK") ||
!strcmp(tag, "CDMA") ||
!strcmp(tag, "PHONE") ||
- !strcmp(tag, "SMS"))
+ !strcmp(tag, "SMS")) {
log_id = LOG_ID_RADIO;
+ // Inform third party apps/ril/radio.. to use Rlog or RLOG
+ snprintf(tmp_tag, sizeof(tmp_tag), "use-Rlog/RLOG-%s", tag);
+ tag = tmp_tag;
+ }
vec[0].iov_base = (unsigned char *) &prio;
vec[0].iov_len = 1;
@@ -163,12 +168,14 @@ int __android_log_write(int prio, const char *tag, const char *msg)
int __android_log_buf_write(int bufID, int prio, const char *tag, const char *msg)
{
struct iovec vec[3];
+ char tmp_tag[32];
if (!tag)
tag = "";
/* XXX: This needs to go! */
- if (!strcmp(tag, "HTC_RIL") ||
+ if ((bufID != LOG_ID_RADIO) &&
+ (!strcmp(tag, "HTC_RIL") ||
!strncmp(tag, "RIL", 3) || /* Any log tag with "RIL" as the prefix */
!strncmp(tag, "IMS", 3) || /* Any log tag with "IMS" as the prefix */
!strcmp(tag, "AT") ||
@@ -176,8 +183,12 @@ int __android_log_buf_write(int bufID, int prio, const char *tag, const char *ms
!strcmp(tag, "STK") ||
!strcmp(tag, "CDMA") ||
!strcmp(tag, "PHONE") ||
- !strcmp(tag, "SMS"))
+ !strcmp(tag, "SMS"))) {
bufID = LOG_ID_RADIO;
+ // Inform third party apps/ril/radio.. to use Rlog or RLOG
+ snprintf(tmp_tag, sizeof(tmp_tag), "use-Rlog/RLOG-%s", tag);
+ tag = tmp_tag;
+ }
vec[0].iov_base = (unsigned char *) &prio;
vec[0].iov_len = 1;