Rewrite syslog(3) to use Android logging.

Since we don't have syslogd on Android and you can't run one on a non-rooted
device, it's more useful if syslog output just goes to the regular Android
logging system.

Bug: 14292866

(cherry picked from commit 3ad8ecb64e)

Change-Id: I3038855ca4f22532bf6d2c45d3f8028b866975f9
This commit is contained in:
Elliott Hughes
2014-07-21 16:35:24 -07:00
parent ed68221a82
commit b76613627d
7 changed files with 105 additions and 413 deletions

View File

@@ -378,6 +378,9 @@ static void out_vformat(Out& o, const char* format, va_list args) {
} else if (c == '%') {
buffer[0] = '%';
buffer[1] = '\0';
} else if (c == 'm') {
// syslog-like %m for strerror(errno).
str = strerror(errno);
} else {
__assert(__FILE__, __LINE__, "conversion specifier unsupported");
}