summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--adb/Android.mk2
-rw-r--r--adb/log_service.c2
-rw-r--r--debuggerd/debuggerd.c5
-rw-r--r--debuggerd/tombstone.c2
-rw-r--r--debuggerd/utility.c2
-rw-r--r--include/cutils/log.h564
-rw-r--r--include/log/event_tag_map.h (renamed from include/cutils/event_tag_map.h)0
-rw-r--r--include/log/log.h563
-rw-r--r--include/log/logd.h (renamed from include/cutils/logd.h)2
-rw-r--r--include/log/logger.h (renamed from include/cutils/logger.h)0
-rw-r--r--include/log/logprint.h (renamed from include/cutils/logprint.h)6
-rw-r--r--include/log/uio.h (renamed from include/cutils/uio.h)0
-rw-r--r--libcutils/Android.mk5
-rw-r--r--liblog/Android.mk3
-rw-r--r--liblog/event_tag_map.c4
-rw-r--r--liblog/fake_log_device.c2
-rw-r--r--liblog/logd_write.c6
-rw-r--r--liblog/logprint.c4
-rw-r--r--liblog/uio.c (renamed from libcutils/uio.c)2
-rw-r--r--logcat/logcat.cpp8
-rw-r--r--toolbox/log.c2
21 files changed, 593 insertions, 591 deletions
diff --git a/adb/Android.mk b/adb/Android.mk
index 36f595b50..721b48d5a 100644
--- a/adb/Android.mk
+++ b/adb/Android.mk
@@ -130,7 +130,7 @@ LOCAL_FORCE_STATIC_EXECUTABLE := true
130LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN) 130LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN)
131LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED) 131LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED)
132 132
133LOCAL_STATIC_LIBRARIES := libcutils libc libmincrypt 133LOCAL_STATIC_LIBRARIES := liblog libcutils libc libmincrypt
134include $(BUILD_EXECUTABLE) 134include $(BUILD_EXECUTABLE)
135 135
136 136
diff --git a/adb/log_service.c b/adb/log_service.c
index 6e9bdeee6..af2435679 100644
--- a/adb/log_service.c
+++ b/adb/log_service.c
@@ -22,7 +22,7 @@
22#include <fcntl.h> 22#include <fcntl.h>
23#include <errno.h> 23#include <errno.h>
24#include <sys/socket.h> 24#include <sys/socket.h>
25#include <cutils/logger.h> 25#include <log/logger.h>
26#include "sysdeps.h" 26#include "sysdeps.h"
27#include "adb.h" 27#include "adb.h"
28 28
diff --git a/debuggerd/debuggerd.c b/debuggerd/debuggerd.c
index 0028bda50..756f7bb10 100644
--- a/debuggerd/debuggerd.c
+++ b/debuggerd/debuggerd.c
@@ -31,9 +31,10 @@
31#include <sys/stat.h> 31#include <sys/stat.h>
32#include <sys/poll.h> 32#include <sys/poll.h>
33 33
34#include <log/logd.h>
35#include <log/logger.h>
36
34#include <cutils/sockets.h> 37#include <cutils/sockets.h>
35#include <cutils/logd.h>
36#include <cutils/logger.h>
37#include <cutils/properties.h> 38#include <cutils/properties.h>
38#include <cutils/debugger.h> 39#include <cutils/debugger.h>
39 40
diff --git a/debuggerd/tombstone.c b/debuggerd/tombstone.c
index 77f6ef1c0..7009a8e02 100644
--- a/debuggerd/tombstone.c
+++ b/debuggerd/tombstone.c
@@ -29,7 +29,7 @@
29 29
30#include <private/android_filesystem_config.h> 30#include <private/android_filesystem_config.h>
31 31
32#include <cutils/logger.h> 32#include <log/logger.h>
33#include <cutils/properties.h> 33#include <cutils/properties.h>
34 34
35#include <corkscrew/demangle.h> 35#include <corkscrew/demangle.h>
diff --git a/debuggerd/utility.c b/debuggerd/utility.c
index 9bf3c18dd..41be9821e 100644
--- a/debuggerd/utility.c
+++ b/debuggerd/utility.c
@@ -22,7 +22,7 @@
22#include <errno.h> 22#include <errno.h>
23#include <unistd.h> 23#include <unistd.h>
24#include <signal.h> 24#include <signal.h>
25#include <cutils/logd.h> 25#include <log/logd.h>
26#include <sys/ptrace.h> 26#include <sys/ptrace.h>
27#include <sys/wait.h> 27#include <sys/wait.h>
28#include <arpa/inet.h> 28#include <arpa/inet.h>
diff --git a/include/cutils/log.h b/include/cutils/log.h
index 8b045c75d..0e0248e50 100644
--- a/include/cutils/log.h
+++ b/include/cutils/log.h
@@ -1,563 +1 @@
1/* #include <log/log.h>
2 * Copyright (C) 2005 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17//
18// C/C++ logging functions. See the logging documentation for API details.
19//
20// We'd like these to be available from C code (in case we import some from
21// somewhere), so this has a C interface.
22//
23// The output will be correct when the log file is shared between multiple
24// threads and/or multiple processes so long as the operating system
25// supports O_APPEND. These calls have mutex-protected data structures
26// and so are NOT reentrant. Do not use LOG in a signal handler.
27//
28#ifndef _LIBS_CUTILS_LOG_H
29#define _LIBS_CUTILS_LOG_H
30
31#include <stdio.h>
32#include <time.h>
33#include <sys/types.h>
34#include <unistd.h>
35#ifdef HAVE_PTHREADS
36#include <pthread.h>
37#endif
38#include <stdarg.h>
39
40#include <cutils/uio.h>
41#include <cutils/logd.h>
42
43#ifdef __cplusplus
44extern "C" {
45#endif
46
47// ---------------------------------------------------------------------
48
49/*
50 * Normally we strip ALOGV (VERBOSE messages) from release builds.
51 * You can modify this (for example with "#define LOG_NDEBUG 0"
52 * at the top of your source file) to change that behavior.
53 */
54#ifndef LOG_NDEBUG
55#ifdef NDEBUG
56#define LOG_NDEBUG 1
57#else
58#define LOG_NDEBUG 0
59#endif
60#endif
61
62/*
63 * This is the local tag used for the following simplified
64 * logging macros. You can change this preprocessor definition
65 * before using the other macros to change the tag.
66 */
67#ifndef LOG_TAG
68#define LOG_TAG NULL
69#endif
70
71// ---------------------------------------------------------------------
72
73/*
74 * Simplified macro to send a verbose log message using the current LOG_TAG.
75 */
76#ifndef ALOGV
77#if LOG_NDEBUG
78#define ALOGV(...) ((void)0)
79#else
80#define ALOGV(...) ((void)ALOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__))
81#endif
82#endif
83
84#define CONDITION(cond) (__builtin_expect((cond)!=0, 0))
85
86#ifndef ALOGV_IF
87#if LOG_NDEBUG
88#define ALOGV_IF(cond, ...) ((void)0)
89#else
90#define ALOGV_IF(cond, ...) \
91 ( (CONDITION(cond)) \
92 ? ((void)ALOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \
93 : (void)0 )
94#endif
95#endif
96
97/*
98 * Simplified macro to send a debug log message using the current LOG_TAG.
99 */
100#ifndef ALOGD
101#define ALOGD(...) ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__))
102#endif
103
104#ifndef ALOGD_IF
105#define ALOGD_IF(cond, ...) \
106 ( (CONDITION(cond)) \
107 ? ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \
108 : (void)0 )
109#endif
110
111/*
112 * Simplified macro to send an info log message using the current LOG_TAG.
113 */
114#ifndef ALOGI
115#define ALOGI(...) ((void)ALOG(LOG_INFO, LOG_TAG, __VA_ARGS__))
116#endif
117
118#ifndef ALOGI_IF
119#define ALOGI_IF(cond, ...) \
120 ( (CONDITION(cond)) \
121 ? ((void)ALOG(LOG_INFO, LOG_TAG, __VA_ARGS__)) \
122 : (void)0 )
123#endif
124
125/*
126 * Simplified macro to send a warning log message using the current LOG_TAG.
127 */
128#ifndef ALOGW
129#define ALOGW(...) ((void)ALOG(LOG_WARN, LOG_TAG, __VA_ARGS__))
130#endif
131
132#ifndef ALOGW_IF
133#define ALOGW_IF(cond, ...) \
134 ( (CONDITION(cond)) \
135 ? ((void)ALOG(LOG_WARN, LOG_TAG, __VA_ARGS__)) \
136 : (void)0 )
137#endif
138
139/*
140 * Simplified macro to send an error log message using the current LOG_TAG.
141 */
142#ifndef ALOGE
143#define ALOGE(...) ((void)ALOG(LOG_ERROR, LOG_TAG, __VA_ARGS__))
144#endif
145
146#ifndef ALOGE_IF
147#define ALOGE_IF(cond, ...) \
148 ( (CONDITION(cond)) \
149 ? ((void)ALOG(LOG_ERROR, LOG_TAG, __VA_ARGS__)) \
150 : (void)0 )
151#endif
152
153// ---------------------------------------------------------------------
154
155/*
156 * Conditional based on whether the current LOG_TAG is enabled at
157 * verbose priority.
158 */
159#ifndef IF_ALOGV
160#if LOG_NDEBUG
161#define IF_ALOGV() if (false)
162#else
163#define IF_ALOGV() IF_ALOG(LOG_VERBOSE, LOG_TAG)
164#endif
165#endif
166
167/*
168 * Conditional based on whether the current LOG_TAG is enabled at
169 * debug priority.
170 */
171#ifndef IF_ALOGD
172#define IF_ALOGD() IF_ALOG(LOG_DEBUG, LOG_TAG)
173#endif
174
175/*
176 * Conditional based on whether the current LOG_TAG is enabled at
177 * info priority.
178 */
179#ifndef IF_ALOGI
180#define IF_ALOGI() IF_ALOG(LOG_INFO, LOG_TAG)
181#endif
182
183/*
184 * Conditional based on whether the current LOG_TAG is enabled at
185 * warn priority.
186 */
187#ifndef IF_ALOGW
188#define IF_ALOGW() IF_ALOG(LOG_WARN, LOG_TAG)
189#endif
190
191/*
192 * Conditional based on whether the current LOG_TAG is enabled at
193 * error priority.
194 */
195#ifndef IF_ALOGE
196#define IF_ALOGE() IF_ALOG(LOG_ERROR, LOG_TAG)
197#endif
198
199
200// ---------------------------------------------------------------------
201
202/*
203 * Simplified macro to send a verbose system log message using the current LOG_TAG.
204 */
205#ifndef SLOGV
206#if LOG_NDEBUG
207#define SLOGV(...) ((void)0)
208#else
209#define SLOGV(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__))
210#endif
211#endif
212
213#define CONDITION(cond) (__builtin_expect((cond)!=0, 0))
214
215#ifndef SLOGV_IF
216#if LOG_NDEBUG
217#define SLOGV_IF(cond, ...) ((void)0)
218#else
219#define SLOGV_IF(cond, ...) \
220 ( (CONDITION(cond)) \
221 ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \
222 : (void)0 )
223#endif
224#endif
225
226/*
227 * Simplified macro to send a debug system log message using the current LOG_TAG.
228 */
229#ifndef SLOGD
230#define SLOGD(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__))
231#endif
232
233#ifndef SLOGD_IF
234#define SLOGD_IF(cond, ...) \
235 ( (CONDITION(cond)) \
236 ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \
237 : (void)0 )
238#endif
239
240/*
241 * Simplified macro to send an info system log message using the current LOG_TAG.
242 */
243#ifndef SLOGI
244#define SLOGI(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__))
245#endif
246
247#ifndef SLOGI_IF
248#define SLOGI_IF(cond, ...) \
249 ( (CONDITION(cond)) \
250 ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)) \
251 : (void)0 )
252#endif
253
254/*
255 * Simplified macro to send a warning system log message using the current LOG_TAG.
256 */
257#ifndef SLOGW
258#define SLOGW(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__))
259#endif
260
261#ifndef SLOGW_IF
262#define SLOGW_IF(cond, ...) \
263 ( (CONDITION(cond)) \
264 ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) \
265 : (void)0 )
266#endif
267
268/*
269 * Simplified macro to send an error system log message using the current LOG_TAG.
270 */
271#ifndef SLOGE
272#define SLOGE(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__))
273#endif
274
275#ifndef SLOGE_IF
276#define SLOGE_IF(cond, ...) \
277 ( (CONDITION(cond)) \
278 ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)) \
279 : (void)0 )
280#endif
281
282// ---------------------------------------------------------------------
283
284/*
285 * Simplified macro to send a verbose radio log message using the current LOG_TAG.
286 */
287#ifndef RLOGV
288#if LOG_NDEBUG
289#define RLOGV(...) ((void)0)
290#else
291#define RLOGV(...) ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__))
292#endif
293#endif
294
295#define CONDITION(cond) (__builtin_expect((cond)!=0, 0))
296
297#ifndef RLOGV_IF
298#if LOG_NDEBUG
299#define RLOGV_IF(cond, ...) ((void)0)
300#else
301#define RLOGV_IF(cond, ...) \
302 ( (CONDITION(cond)) \
303 ? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \
304 : (void)0 )
305#endif
306#endif
307
308/*
309 * Simplified macro to send a debug radio log message using the current LOG_TAG.
310 */
311#ifndef RLOGD
312#define RLOGD(...) ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__))
313#endif
314
315#ifndef RLOGD_IF
316#define RLOGD_IF(cond, ...) \
317 ( (CONDITION(cond)) \
318 ? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \
319 : (void)0 )
320#endif
321
322/*
323 * Simplified macro to send an info radio log message using the current LOG_TAG.
324 */
325#ifndef RLOGI
326#define RLOGI(...) ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__))
327#endif
328
329#ifndef RLOGI_IF
330#define RLOGI_IF(cond, ...) \
331 ( (CONDITION(cond)) \
332 ? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)) \
333 : (void)0 )
334#endif
335
336/*
337 * Simplified macro to send a warning radio log message using the current LOG_TAG.
338 */
339#ifndef RLOGW
340#define RLOGW(...) ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__))
341#endif
342
343#ifndef RLOGW_IF
344#define RLOGW_IF(cond, ...) \
345 ( (CONDITION(cond)) \
346 ? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) \
347 : (void)0 )
348#endif
349
350/*
351 * Simplified macro to send an error radio log message using the current LOG_TAG.
352 */
353#ifndef RLOGE
354#define RLOGE(...) ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__))
355#endif
356
357#ifndef RLOGE_IF
358#define RLOGE_IF(cond, ...) \
359 ( (CONDITION(cond)) \
360 ? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)) \
361 : (void)0 )
362#endif
363
364
365// ---------------------------------------------------------------------
366
367/*
368 * Log a fatal error. If the given condition fails, this stops program
369 * execution like a normal assertion, but also generating the given message.
370 * It is NOT stripped from release builds. Note that the condition test
371 * is -inverted- from the normal assert() semantics.
372 */
373#ifndef LOG_ALWAYS_FATAL_IF
374#define LOG_ALWAYS_FATAL_IF(cond, ...) \
375 ( (CONDITION(cond)) \
376 ? ((void)android_printAssert(#cond, LOG_TAG, ## __VA_ARGS__)) \
377 : (void)0 )
378#endif
379
380#ifndef LOG_ALWAYS_FATAL
381#define LOG_ALWAYS_FATAL(...) \
382 ( ((void)android_printAssert(NULL, LOG_TAG, ## __VA_ARGS__)) )
383#endif
384
385/*
386 * Versions of LOG_ALWAYS_FATAL_IF and LOG_ALWAYS_FATAL that
387 * are stripped out of release builds.
388 */
389#if LOG_NDEBUG
390
391#ifndef LOG_FATAL_IF
392#define LOG_FATAL_IF(cond, ...) ((void)0)
393#endif
394#ifndef LOG_FATAL
395#define LOG_FATAL(...) ((void)0)
396#endif
397
398#else
399
400#ifndef LOG_FATAL_IF
401#define LOG_FATAL_IF(cond, ...) LOG_ALWAYS_FATAL_IF(cond, ## __VA_ARGS__)
402#endif
403#ifndef LOG_FATAL
404#define LOG_FATAL(...) LOG_ALWAYS_FATAL(__VA_ARGS__)
405#endif
406
407#endif
408
409/*
410 * Assertion that generates a log message when the assertion fails.
411 * Stripped out of release builds. Uses the current LOG_TAG.
412 */
413#ifndef ALOG_ASSERT
414#define ALOG_ASSERT(cond, ...) LOG_FATAL_IF(!(cond), ## __VA_ARGS__)
415//#define ALOG_ASSERT(cond) LOG_FATAL_IF(!(cond), "Assertion failed: " #cond)
416#endif
417
418// ---------------------------------------------------------------------
419
420/*
421 * Basic log message macro.
422 *
423 * Example:
424 * ALOG(LOG_WARN, NULL, "Failed with error %d", errno);
425 *
426 * The second argument may be NULL or "" to indicate the "global" tag.
427 */
428#ifndef ALOG
429#define ALOG(priority, tag, ...) \
430 LOG_PRI(ANDROID_##priority, tag, __VA_ARGS__)
431#endif
432
433/*
434 * Log macro that allows you to specify a number for the priority.
435 */
436#ifndef LOG_PRI
437#define LOG_PRI(priority, tag, ...) \
438 android_printLog(priority, tag, __VA_ARGS__)
439#endif
440
441/*
442 * Log macro that allows you to pass in a varargs ("args" is a va_list).
443 */
444#ifndef LOG_PRI_VA
445#define LOG_PRI_VA(priority, tag, fmt, args) \
446 android_vprintLog(priority, NULL, tag, fmt, args)
447#endif
448
449/*
450 * Conditional given a desired logging priority and tag.
451 */
452#ifndef IF_ALOG
453#define IF_ALOG(priority, tag) \
454 if (android_testLog(ANDROID_##priority, tag))
455#endif
456
457// ---------------------------------------------------------------------
458
459/*
460 * Event logging.
461 */
462
463/*
464 * Event log entry types. These must match up with the declarations in
465 * java/android/android/util/EventLog.java.
466 */
467typedef enum {
468 EVENT_TYPE_INT = 0,
469 EVENT_TYPE_LONG = 1,
470 EVENT_TYPE_STRING = 2,
471 EVENT_TYPE_LIST = 3,
472} AndroidEventLogType;
473
474
475#ifndef LOG_EVENT_INT
476#define LOG_EVENT_INT(_tag, _value) { \
477 int intBuf = _value; \
478 (void) android_btWriteLog(_tag, EVENT_TYPE_INT, &intBuf, \
479 sizeof(intBuf)); \
480 }
481#endif
482#ifndef LOG_EVENT_LONG
483#define LOG_EVENT_LONG(_tag, _value) { \
484 long long longBuf = _value; \
485 (void) android_btWriteLog(_tag, EVENT_TYPE_LONG, &longBuf, \
486 sizeof(longBuf)); \
487 }
488#endif
489#ifndef LOG_EVENT_STRING
490#define LOG_EVENT_STRING(_tag, _value) \
491 ((void) 0) /* not implemented -- must combine len with string */
492#endif
493/* TODO: something for LIST */
494
495/*
496 * ===========================================================================
497 *
498 * The stuff in the rest of this file should not be used directly.
499 */
500
501#define android_printLog(prio, tag, fmt...) \
502 __android_log_print(prio, tag, fmt)
503
504#define android_vprintLog(prio, cond, tag, fmt...) \
505 __android_log_vprint(prio, tag, fmt)
506
507/* XXX Macros to work around syntax errors in places where format string
508 * arg is not passed to ALOG_ASSERT, LOG_ALWAYS_FATAL or LOG_ALWAYS_FATAL_IF
509 * (happens only in debug builds).
510 */
511
512/* Returns 2nd arg. Used to substitute default value if caller's vararg list
513 * is empty.
514 */
515#define __android_second(dummy, second, ...) second
516
517/* If passed multiple args, returns ',' followed by all but 1st arg, otherwise
518 * returns nothing.
519 */
520#define __android_rest(first, ...) , ## __VA_ARGS__
521
522#define android_printAssert(cond, tag, fmt...) \
523 __android_log_assert(cond, tag, \
524 __android_second(0, ## fmt, NULL) __android_rest(fmt))
525
526#define android_writeLog(prio, tag, text) \
527 __android_log_write(prio, tag, text)
528
529#define android_bWriteLog(tag, payload, len) \
530 __android_log_bwrite(tag, payload, len)
531#define android_btWriteLog(tag, type, payload, len) \
532 __android_log_btwrite(tag, type, payload, len)
533
534// TODO: remove these prototypes and their users
535#define android_testLog(prio, tag) (1)
536#define android_writevLog(vec,num) do{}while(0)
537#define android_write1Log(str,len) do{}while (0)
538#define android_setMinPriority(tag, prio) do{}while(0)
539//#define android_logToCallback(func) do{}while(0)
540#define android_logToFile(tag, file) (0)
541#define android_logToFd(tag, fd) (0)
542
543typedef enum {
544 LOG_ID_MAIN = 0,
545 LOG_ID_RADIO = 1,
546 LOG_ID_EVENTS = 2,
547 LOG_ID_SYSTEM = 3,
548
549 LOG_ID_MAX
550} log_id_t;
551
552/*
553 * Send a simple string to the log.
554 */
555int __android_log_buf_write(int bufID, int prio, const char *tag, const char *text);
556int __android_log_buf_print(int bufID, int prio, const char *tag, const char *fmt, ...);
557
558
559#ifdef __cplusplus
560}
561#endif
562
563#endif // _LIBS_CUTILS_LOG_H
diff --git a/include/cutils/event_tag_map.h b/include/log/event_tag_map.h
index 1653c61e9..1653c61e9 100644
--- a/include/cutils/event_tag_map.h
+++ b/include/log/event_tag_map.h
diff --git a/include/log/log.h b/include/log/log.h
new file mode 100644
index 000000000..7faddea91
--- /dev/null
+++ b/include/log/log.h
@@ -0,0 +1,563 @@
1/*
2 * Copyright (C) 2005 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17//
18// C/C++ logging functions. See the logging documentation for API details.
19//
20// We'd like these to be available from C code (in case we import some from
21// somewhere), so this has a C interface.
22//
23// The output will be correct when the log file is shared between multiple
24// threads and/or multiple processes so long as the operating system
25// supports O_APPEND. These calls have mutex-protected data structures
26// and so are NOT reentrant. Do not use LOG in a signal handler.
27//
28#ifndef _LIBS_LOG_LOG_H
29#define _LIBS_LOG_LOG_H
30
31#include <stdio.h>
32#include <time.h>
33#include <sys/types.h>
34#include <unistd.h>
35#ifdef HAVE_PTHREADS
36#include <pthread.h>
37#endif
38#include <stdarg.h>
39
40#include <log/uio.h>
41#include <log/logd.h>
42
43#ifdef __cplusplus
44extern "C" {
45#endif
46
47// ---------------------------------------------------------------------
48
49/*
50 * Normally we strip ALOGV (VERBOSE messages) from release builds.
51 * You can modify this (for example with "#define LOG_NDEBUG 0"
52 * at the top of your source file) to change that behavior.
53 */
54#ifndef LOG_NDEBUG
55#ifdef NDEBUG
56#define LOG_NDEBUG 1
57#else
58#define LOG_NDEBUG 0
59#endif
60#endif
61
62/*
63 * This is the local tag used for the following simplified
64 * logging macros. You can change this preprocessor definition
65 * before using the other macros to change the tag.
66 */
67#ifndef LOG_TAG
68#define LOG_TAG NULL
69#endif
70
71// ---------------------------------------------------------------------
72
73/*
74 * Simplified macro to send a verbose log message using the current LOG_TAG.
75 */
76#ifndef ALOGV
77#if LOG_NDEBUG
78#define ALOGV(...) ((void)0)
79#else
80#define ALOGV(...) ((void)ALOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__))
81#endif
82#endif
83
84#define CONDITION(cond) (__builtin_expect((cond)!=0, 0))
85
86#ifndef ALOGV_IF
87#if LOG_NDEBUG
88#define ALOGV_IF(cond, ...) ((void)0)
89#else
90#define ALOGV_IF(cond, ...) \
91 ( (CONDITION(cond)) \
92 ? ((void)ALOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \
93 : (void)0 )
94#endif
95#endif
96
97/*
98 * Simplified macro to send a debug log message using the current LOG_TAG.
99 */
100#ifndef ALOGD
101#define ALOGD(...) ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__))
102#endif
103
104#ifndef ALOGD_IF
105#define ALOGD_IF(cond, ...) \
106 ( (CONDITION(cond)) \
107 ? ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \
108 : (void)0 )
109#endif
110
111/*
112 * Simplified macro to send an info log message using the current LOG_TAG.
113 */
114#ifndef ALOGI
115#define ALOGI(...) ((void)ALOG(LOG_INFO, LOG_TAG, __VA_ARGS__))
116#endif
117
118#ifndef ALOGI_IF
119#define ALOGI_IF(cond, ...) \
120 ( (CONDITION(cond)) \
121 ? ((void)ALOG(LOG_INFO, LOG_TAG, __VA_ARGS__)) \
122 : (void)0 )
123#endif
124
125/*
126 * Simplified macro to send a warning log message using the current LOG_TAG.
127 */
128#ifndef ALOGW
129#define ALOGW(...) ((void)ALOG(LOG_WARN, LOG_TAG, __VA_ARGS__))
130#endif
131
132#ifndef ALOGW_IF
133#define ALOGW_IF(cond, ...) \
134 ( (CONDITION(cond)) \
135 ? ((void)ALOG(LOG_WARN, LOG_TAG, __VA_ARGS__)) \
136 : (void)0 )
137#endif
138
139/*
140 * Simplified macro to send an error log message using the current LOG_TAG.
141 */
142#ifndef ALOGE
143#define ALOGE(...) ((void)ALOG(LOG_ERROR, LOG_TAG, __VA_ARGS__))
144#endif
145
146#ifndef ALOGE_IF
147#define ALOGE_IF(cond, ...) \
148 ( (CONDITION(cond)) \
149 ? ((void)ALOG(LOG_ERROR, LOG_TAG, __VA_ARGS__)) \
150 : (void)0 )
151#endif
152
153// ---------------------------------------------------------------------
154
155/*
156 * Conditional based on whether the current LOG_TAG is enabled at
157 * verbose priority.
158 */
159#ifndef IF_ALOGV
160#if LOG_NDEBUG
161#define IF_ALOGV() if (false)
162#else
163#define IF_ALOGV() IF_ALOG(LOG_VERBOSE, LOG_TAG)
164#endif
165#endif
166
167/*
168 * Conditional based on whether the current LOG_TAG is enabled at
169 * debug priority.
170 */
171#ifndef IF_ALOGD
172#define IF_ALOGD() IF_ALOG(LOG_DEBUG, LOG_TAG)
173#endif
174
175/*
176 * Conditional based on whether the current LOG_TAG is enabled at
177 * info priority.
178 */
179#ifndef IF_ALOGI
180#define IF_ALOGI() IF_ALOG(LOG_INFO, LOG_TAG)
181#endif
182
183/*
184 * Conditional based on whether the current LOG_TAG is enabled at
185 * warn priority.
186 */
187#ifndef IF_ALOGW
188#define IF_ALOGW() IF_ALOG(LOG_WARN, LOG_TAG)
189#endif
190
191/*
192 * Conditional based on whether the current LOG_TAG is enabled at
193 * error priority.
194 */
195#ifndef IF_ALOGE
196#define IF_ALOGE() IF_ALOG(LOG_ERROR, LOG_TAG)
197#endif
198
199
200// ---------------------------------------------------------------------
201
202/*
203 * Simplified macro to send a verbose system log message using the current LOG_TAG.
204 */
205#ifndef SLOGV
206#if LOG_NDEBUG
207#define SLOGV(...) ((void)0)
208#else
209#define SLOGV(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__))
210#endif
211#endif
212
213#define CONDITION(cond) (__builtin_expect((cond)!=0, 0))
214
215#ifndef SLOGV_IF
216#if LOG_NDEBUG
217#define SLOGV_IF(cond, ...) ((void)0)
218#else
219#define SLOGV_IF(cond, ...) \
220 ( (CONDITION(cond)) \
221 ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \
222 : (void)0 )
223#endif
224#endif
225
226/*
227 * Simplified macro to send a debug system log message using the current LOG_TAG.
228 */
229#ifndef SLOGD
230#define SLOGD(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__))
231#endif
232
233#ifndef SLOGD_IF
234#define SLOGD_IF(cond, ...) \
235 ( (CONDITION(cond)) \
236 ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \
237 : (void)0 )
238#endif
239
240/*
241 * Simplified macro to send an info system log message using the current LOG_TAG.
242 */
243#ifndef SLOGI
244#define SLOGI(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__))
245#endif
246
247#ifndef SLOGI_IF
248#define SLOGI_IF(cond, ...) \
249 ( (CONDITION(cond)) \
250 ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)) \
251 : (void)0 )
252#endif
253
254/*
255 * Simplified macro to send a warning system log message using the current LOG_TAG.
256 */
257#ifndef SLOGW
258#define SLOGW(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__))
259#endif
260
261#ifndef SLOGW_IF
262#define SLOGW_IF(cond, ...) \
263 ( (CONDITION(cond)) \
264 ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) \
265 : (void)0 )
266#endif
267
268/*
269 * Simplified macro to send an error system log message using the current LOG_TAG.
270 */
271#ifndef SLOGE
272#define SLOGE(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__))
273#endif
274
275#ifndef SLOGE_IF
276#define SLOGE_IF(cond, ...) \
277 ( (CONDITION(cond)) \
278 ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)) \
279 : (void)0 )
280#endif
281
282// ---------------------------------------------------------------------
283
284/*
285 * Simplified macro to send a verbose radio log message using the current LOG_TAG.
286 */
287#ifndef RLOGV
288#if LOG_NDEBUG
289#define RLOGV(...) ((void)0)
290#else
291#define RLOGV(...) ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__))
292#endif
293#endif
294
295#define CONDITION(cond) (__builtin_expect((cond)!=0, 0))
296
297#ifndef RLOGV_IF
298#if LOG_NDEBUG
299#define RLOGV_IF(cond, ...) ((void)0)
300#else
301#define RLOGV_IF(cond, ...) \
302 ( (CONDITION(cond)) \
303 ? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \
304 : (void)0 )
305#endif
306#endif
307
308/*
309 * Simplified macro to send a debug radio log message using the current LOG_TAG.
310 */
311#ifndef RLOGD
312#define RLOGD(...) ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__))
313#endif
314
315#ifndef RLOGD_IF
316#define RLOGD_IF(cond, ...) \
317 ( (CONDITION(cond)) \
318 ? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \
319 : (void)0 )
320#endif
321
322/*
323 * Simplified macro to send an info radio log message using the current LOG_TAG.
324 */
325#ifndef RLOGI
326#define RLOGI(...) ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__))
327#endif
328
329#ifndef RLOGI_IF
330#define RLOGI_IF(cond, ...) \
331 ( (CONDITION(cond)) \
332 ? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)) \
333 : (void)0 )
334#endif
335
336/*
337 * Simplified macro to send a warning radio log message using the current LOG_TAG.
338 */
339#ifndef RLOGW
340#define RLOGW(...) ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__))
341#endif
342
343#ifndef RLOGW_IF
344#define RLOGW_IF(cond, ...) \
345 ( (CONDITION(cond)) \
346 ? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) \
347 : (void)0 )
348#endif
349
350/*
351 * Simplified macro to send an error radio log message using the current LOG_TAG.
352 */
353#ifndef RLOGE
354#define RLOGE(...) ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__))
355#endif
356
357#ifndef RLOGE_IF
358#define RLOGE_IF(cond, ...) \
359 ( (CONDITION(cond)) \
360 ? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)) \
361 : (void)0 )
362#endif
363
364
365// ---------------------------------------------------------------------
366
367/*
368 * Log a fatal error. If the given condition fails, this stops program
369 * execution like a normal assertion, but also generating the given message.
370 * It is NOT stripped from release builds. Note that the condition test
371 * is -inverted- from the normal assert() semantics.
372 */
373#ifndef LOG_ALWAYS_FATAL_IF
374#define LOG_ALWAYS_FATAL_IF(cond, ...) \
375 ( (CONDITION(cond)) \
376 ? ((void)android_printAssert(#cond, LOG_TAG, ## __VA_ARGS__)) \
377 : (void)0 )
378#endif
379
380#ifndef LOG_ALWAYS_FATAL
381#define LOG_ALWAYS_FATAL(...) \
382 ( ((void)android_printAssert(NULL, LOG_TAG, ## __VA_ARGS__)) )
383#endif
384
385/*
386 * Versions of LOG_ALWAYS_FATAL_IF and LOG_ALWAYS_FATAL that
387 * are stripped out of release builds.
388 */
389#if LOG_NDEBUG
390
391#ifndef LOG_FATAL_IF
392#define LOG_FATAL_IF(cond, ...) ((void)0)
393#endif
394#ifndef LOG_FATAL
395#define LOG_FATAL(...) ((void)0)
396#endif
397
398#else
399
400#ifndef LOG_FATAL_IF
401#define LOG_FATAL_IF(cond, ...) LOG_ALWAYS_FATAL_IF(cond, ## __VA_ARGS__)
402#endif
403#ifndef LOG_FATAL
404#define LOG_FATAL(...) LOG_ALWAYS_FATAL(__VA_ARGS__)
405#endif
406
407#endif
408
409/*
410 * Assertion that generates a log message when the assertion fails.
411 * Stripped out of release builds. Uses the current LOG_TAG.
412 */
413#ifndef ALOG_ASSERT
414#define ALOG_ASSERT(cond, ...) LOG_FATAL_IF(!(cond), ## __VA_ARGS__)
415//#define ALOG_ASSERT(cond) LOG_FATAL_IF(!(cond), "Assertion failed: " #cond)
416#endif
417
418// ---------------------------------------------------------------------
419
420/*
421 * Basic log message macro.
422 *
423 * Example:
424 * ALOG(LOG_WARN, NULL, "Failed with error %d", errno);
425 *
426 * The second argument may be NULL or "" to indicate the "global" tag.
427 */
428#ifndef ALOG
429#define ALOG(priority, tag, ...) \
430 LOG_PRI(ANDROID_##priority, tag, __VA_ARGS__)
431#endif
432
433/*
434 * Log macro that allows you to specify a number for the priority.
435 */
436#ifndef LOG_PRI
437#define LOG_PRI(priority, tag, ...) \
438 android_printLog(priority, tag, __VA_ARGS__)
439#endif
440
441/*
442 * Log macro that allows you to pass in a varargs ("args" is a va_list).
443 */
444#ifndef LOG_PRI_VA
445#define LOG_PRI_VA(priority, tag, fmt, args) \
446 android_vprintLog(priority, NULL, tag, fmt, args)
447#endif
448
449/*
450 * Conditional given a desired logging priority and tag.
451 */
452#ifndef IF_ALOG
453#define IF_ALOG(priority, tag) \
454 if (android_testLog(ANDROID_##priority, tag))
455#endif
456
457// ---------------------------------------------------------------------
458
459/*
460 * Event logging.
461 */
462
463/*
464 * Event log entry types. These must match up with the declarations in
465 * java/android/android/util/EventLog.java.
466 */
467typedef enum {
468 EVENT_TYPE_INT = 0,
469 EVENT_TYPE_LONG = 1,
470 EVENT_TYPE_STRING = 2,
471 EVENT_TYPE_LIST = 3,
472} AndroidEventLogType;
473
474
475#ifndef LOG_EVENT_INT
476#define LOG_EVENT_INT(_tag, _value) { \
477 int intBuf = _value; \
478 (void) android_btWriteLog(_tag, EVENT_TYPE_INT, &intBuf, \
479 sizeof(intBuf)); \
480 }
481#endif
482#ifndef LOG_EVENT_LONG
483#define LOG_EVENT_LONG(_tag, _value) { \
484 long long longBuf = _value; \
485 (void) android_btWriteLog(_tag, EVENT_TYPE_LONG, &longBuf, \
486 sizeof(longBuf)); \
487 }
488#endif
489#ifndef LOG_EVENT_STRING
490#define LOG_EVENT_STRING(_tag, _value) \
491 ((void) 0) /* not implemented -- must combine len with string */
492#endif
493/* TODO: something for LIST */
494
495/*
496 * ===========================================================================
497 *
498 * The stuff in the rest of this file should not be used directly.
499 */
500
501#define android_printLog(prio, tag, fmt...) \
502 __android_log_print(prio, tag, fmt)
503
504#define android_vprintLog(prio, cond, tag, fmt...) \
505 __android_log_vprint(prio, tag, fmt)
506
507/* XXX Macros to work around syntax errors in places where format string
508 * arg is not passed to ALOG_ASSERT, LOG_ALWAYS_FATAL or LOG_ALWAYS_FATAL_IF
509 * (happens only in debug builds).
510 */
511
512/* Returns 2nd arg. Used to substitute default value if caller's vararg list
513 * is empty.
514 */
515#define __android_second(dummy, second, ...) second
516
517/* If passed multiple args, returns ',' followed by all but 1st arg, otherwise
518 * returns nothing.
519 */
520#define __android_rest(first, ...) , ## __VA_ARGS__
521
522#define android_printAssert(cond, tag, fmt...) \
523 __android_log_assert(cond, tag, \
524 __android_second(0, ## fmt, NULL) __android_rest(fmt))
525
526#define android_writeLog(prio, tag, text) \
527 __android_log_write(prio, tag, text)
528
529#define android_bWriteLog(tag, payload, len) \
530 __android_log_bwrite(tag, payload, len)
531#define android_btWriteLog(tag, type, payload, len) \
532 __android_log_btwrite(tag, type, payload, len)
533
534// TODO: remove these prototypes and their users
535#define android_testLog(prio, tag) (1)
536#define android_writevLog(vec,num) do{}while(0)
537#define android_write1Log(str,len) do{}while (0)
538#define android_setMinPriority(tag, prio) do{}while(0)
539//#define android_logToCallback(func) do{}while(0)
540#define android_logToFile(tag, file) (0)
541#define android_logToFd(tag, fd) (0)
542
543typedef enum {
544 LOG_ID_MAIN = 0,
545 LOG_ID_RADIO = 1,
546 LOG_ID_EVENTS = 2,
547 LOG_ID_SYSTEM = 3,
548
549 LOG_ID_MAX
550} log_id_t;
551
552/*
553 * Send a simple string to the log.
554 */
555int __android_log_buf_write(int bufID, int prio, const char *tag, const char *text);
556int __android_log_buf_print(int bufID, int prio, const char *tag, const char *fmt, ...);
557
558
559#ifdef __cplusplus
560}
561#endif
562
563#endif // _LIBS_CUTILS_LOG_H
diff --git a/include/cutils/logd.h b/include/log/logd.h
index 8737639cc..379c37334 100644
--- a/include/cutils/logd.h
+++ b/include/log/logd.h
@@ -31,7 +31,7 @@
31#ifdef HAVE_PTHREADS 31#ifdef HAVE_PTHREADS
32#include <pthread.h> 32#include <pthread.h>
33#endif 33#endif
34#include <cutils/uio.h> 34#include <log/uio.h>
35#include <stdarg.h> 35#include <stdarg.h>
36 36
37#ifdef __cplusplus 37#ifdef __cplusplus
diff --git a/include/cutils/logger.h b/include/log/logger.h
index 04f3fb05b..04f3fb05b 100644
--- a/include/cutils/logger.h
+++ b/include/log/logger.h
diff --git a/include/cutils/logprint.h b/include/log/logprint.h
index 2b1e1c515..481c96e2e 100644
--- a/include/cutils/logprint.h
+++ b/include/log/logprint.h
@@ -17,9 +17,9 @@
17#ifndef _LOGPRINT_H 17#ifndef _LOGPRINT_H
18#define _LOGPRINT_H 18#define _LOGPRINT_H
19 19
20#include <cutils/log.h> 20#include <log/log.h>
21#include <cutils/logger.h> 21#include <log/logger.h>
22#include <cutils/event_tag_map.h> 22#include <log/event_tag_map.h>
23#include <pthread.h> 23#include <pthread.h>
24 24
25#ifdef __cplusplus 25#ifdef __cplusplus
diff --git a/include/cutils/uio.h b/include/log/uio.h
index 01a74d26f..01a74d26f 100644
--- a/include/cutils/uio.h
+++ b/include/log/uio.h
diff --git a/libcutils/Android.mk b/libcutils/Android.mk
index e46216eec..0fd5a57e0 100644
--- a/libcutils/Android.mk
+++ b/libcutils/Android.mk
@@ -65,10 +65,7 @@ ifneq ($(strip $(USE_MINGW)),)
65 WINDOWS_HOST_ONLY := 1 65 WINDOWS_HOST_ONLY := 1
66endif 66endif
67 67
68ifeq ($(WINDOWS_HOST_ONLY),1) 68ifneq ($(WINDOWS_HOST_ONLY),1)
69 commonSources += \
70 uio.c
71else
72 commonSources += \ 69 commonSources += \
73 fs.c \ 70 fs.c \
74 multiuser.c 71 multiuser.c
diff --git a/liblog/Android.mk b/liblog/Android.mk
index be5cec261..6bfb11966 100644
--- a/liblog/Android.mk
+++ b/liblog/Android.mk
@@ -36,6 +36,9 @@ ifndef WITH_MINGW
36 liblog_sources += \ 36 liblog_sources += \
37 logprint.c \ 37 logprint.c \
38 event_tag_map.c 38 event_tag_map.c
39else
40 liblog_sources += \
41 uio.c
39endif 42endif
40 43
41liblog_host_sources := $(liblog_sources) fake_log_device.c 44liblog_host_sources := $(liblog_sources) fake_log_device.c
diff --git a/liblog/event_tag_map.c b/liblog/event_tag_map.c
index e70754e17..f3d1e2fe2 100644
--- a/liblog/event_tag_map.c
+++ b/liblog/event_tag_map.c
@@ -13,8 +13,8 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16#include "cutils/event_tag_map.h" 16#include <log/event_tag_map.h>
17#include "cutils/log.h" 17#include <log/log.h>
18 18
19#include <stdlib.h> 19#include <stdlib.h>
20#include <string.h> 20#include <string.h>
diff --git a/liblog/fake_log_device.c b/liblog/fake_log_device.c
index df4329921..528361986 100644
--- a/liblog/fake_log_device.c
+++ b/liblog/fake_log_device.c
@@ -19,7 +19,7 @@
19 * passed on to the underlying (fake) log device. When not in the 19 * passed on to the underlying (fake) log device. When not in the
20 * simulator, messages are printed to stderr. 20 * simulator, messages are printed to stderr.
21 */ 21 */
22#include "cutils/logd.h" 22#include <log/logd.h>
23 23
24#include <stdlib.h> 24#include <stdlib.h>
25#include <string.h> 25#include <string.h>
diff --git a/liblog/logd_write.c b/liblog/logd_write.c
index 3613d25f2..fff7cc4dd 100644
--- a/liblog/logd_write.c
+++ b/liblog/logd_write.c
@@ -27,9 +27,9 @@
27#include <sys/types.h> 27#include <sys/types.h>
28#include <sys/stat.h> 28#include <sys/stat.h>
29 29
30#include <cutils/logger.h> 30#include <log/logger.h>
31#include <cutils/logd.h> 31#include <log/logd.h>
32#include <cutils/log.h> 32#include <log/log.h>
33 33
34#define LOG_BUF_SIZE 1024 34#define LOG_BUF_SIZE 1024
35 35
diff --git a/liblog/logprint.c b/liblog/logprint.c
index 6fac84b46..508c82565 100644
--- a/liblog/logprint.c
+++ b/liblog/logprint.c
@@ -26,8 +26,8 @@
26#include <assert.h> 26#include <assert.h>
27#include <arpa/inet.h> 27#include <arpa/inet.h>
28 28
29#include <cutils/logd.h> 29#include <log/logd.h>
30#include <cutils/logprint.h> 30#include <log/logprint.h>
31 31
32typedef struct FilterInfo_t { 32typedef struct FilterInfo_t {
33 char *mTag; 33 char *mTag;
diff --git a/libcutils/uio.c b/liblog/uio.c
index baa8051bc..cfa4cb122 100644
--- a/libcutils/uio.c
+++ b/liblog/uio.c
@@ -16,7 +16,7 @@
16 16
17#ifndef HAVE_SYS_UIO_H 17#ifndef HAVE_SYS_UIO_H
18 18
19#include <cutils/uio.h> 19#include <log/uio.h>
20#include <unistd.h> 20#include <unistd.h>
21 21
22int readv( int fd, struct iovec* vecs, int count ) 22int readv( int fd, struct iovec* vecs, int count )
diff --git a/logcat/logcat.cpp b/logcat/logcat.cpp
index d3b5ed0b9..d44c6796b 100644
--- a/logcat/logcat.cpp
+++ b/logcat/logcat.cpp
@@ -1,10 +1,10 @@
1// Copyright 2006 The Android Open Source Project 1// Copyright 2006 The Android Open Source Project
2 2
3#include <cutils/logger.h> 3#include <log/logger.h>
4#include <cutils/logd.h> 4#include <log/logd.h>
5#include <log/logprint.h>
6#include <log/event_tag_map.h>
5#include <cutils/sockets.h> 7#include <cutils/sockets.h>
6#include <cutils/logprint.h>
7#include <cutils/event_tag_map.h>
8 8
9#include <stdio.h> 9#include <stdio.h>
10#include <stdlib.h> 10#include <stdlib.h>
diff --git a/toolbox/log.c b/toolbox/log.c
index 0bee19e90..2f020a8a4 100644
--- a/toolbox/log.c
+++ b/toolbox/log.c
@@ -30,7 +30,7 @@
30 */ 30 */
31 31
32#include <stdio.h> 32#include <stdio.h>
33#include <cutils/logd.h> 33#include <log/logd.h>
34#include <ctype.h> 34#include <ctype.h>
35#include <sys/socket.h> 35#include <sys/socket.h>
36#include <sys/types.h> 36#include <sys/types.h>