blob: 4abd774eeb686cbe37e852f68922c17589409219 [file] [log] [blame]
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -08001/*
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 LOGV (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 LOGV
77#if LOG_NDEBUG
78#define LOGV(...) ((void)0)
79#else
Steve Block61fbcbe2011-10-12 17:22:43 +010080#define LOGV(...) ((void)ALOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__))
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080081#endif
Steve Block25a89e72011-10-28 15:36:41 +010082#define ALOGV LOGV
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080083#endif
84
85#define CONDITION(cond) (__builtin_expect((cond)!=0, 0))
86
87#ifndef LOGV_IF
88#if LOG_NDEBUG
89#define LOGV_IF(cond, ...) ((void)0)
90#else
91#define LOGV_IF(cond, ...) \
92 ( (CONDITION(cond)) \
Steve Block61fbcbe2011-10-12 17:22:43 +010093 ? ((void)ALOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080094 : (void)0 )
95#endif
Steve Block25a89e72011-10-28 15:36:41 +010096#define ALOGV_IF LOGV_IF
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080097#endif
98
99/*
100 * Simplified macro to send a debug log message using the current LOG_TAG.
101 */
102#ifndef LOGD
Steve Block61fbcbe2011-10-12 17:22:43 +0100103#define LOGD(...) ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__))
Steve Blocke7e7fac2011-12-22 15:00:35 +0000104#define ALOGD LOGD
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800105#endif
106
107#ifndef LOGD_IF
108#define LOGD_IF(cond, ...) \
109 ( (CONDITION(cond)) \
Steve Block61fbcbe2011-10-12 17:22:43 +0100110 ? ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800111 : (void)0 )
Steve Blocke7e7fac2011-12-22 15:00:35 +0000112#define ALOGD_IF LOGD_IF
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800113#endif
114
115/*
116 * Simplified macro to send an info log message using the current LOG_TAG.
117 */
118#ifndef LOGI
Steve Block61fbcbe2011-10-12 17:22:43 +0100119#define LOGI(...) ((void)ALOG(LOG_INFO, LOG_TAG, __VA_ARGS__))
Steve Blocke7e7fac2011-12-22 15:00:35 +0000120#define ALOGI LOGI
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800121#endif
122
123#ifndef LOGI_IF
124#define LOGI_IF(cond, ...) \
125 ( (CONDITION(cond)) \
Steve Block61fbcbe2011-10-12 17:22:43 +0100126 ? ((void)ALOG(LOG_INFO, LOG_TAG, __VA_ARGS__)) \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800127 : (void)0 )
Steve Blocke7e7fac2011-12-22 15:00:35 +0000128#define ALOGI_IF LOGI_IF
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800129#endif
130
131/*
132 * Simplified macro to send a warning log message using the current LOG_TAG.
133 */
134#ifndef LOGW
Steve Block61fbcbe2011-10-12 17:22:43 +0100135#define LOGW(...) ((void)ALOG(LOG_WARN, LOG_TAG, __VA_ARGS__))
Steve Blocke7e7fac2011-12-22 15:00:35 +0000136#define ALOGW LOGW
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800137#endif
138
139#ifndef LOGW_IF
140#define LOGW_IF(cond, ...) \
141 ( (CONDITION(cond)) \
Steve Block61fbcbe2011-10-12 17:22:43 +0100142 ? ((void)ALOG(LOG_WARN, LOG_TAG, __VA_ARGS__)) \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800143 : (void)0 )
Steve Blocke7e7fac2011-12-22 15:00:35 +0000144#define ALOGW_IF LOGW_IF
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800145#endif
146
147/*
148 * Simplified macro to send an error log message using the current LOG_TAG.
149 */
150#ifndef LOGE
Steve Block61fbcbe2011-10-12 17:22:43 +0100151#define LOGE(...) ((void)ALOG(LOG_ERROR, LOG_TAG, __VA_ARGS__))
Steve Blocke7e7fac2011-12-22 15:00:35 +0000152#define ALOGE LOGE
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800153#endif
154
155#ifndef LOGE_IF
156#define LOGE_IF(cond, ...) \
157 ( (CONDITION(cond)) \
Steve Block61fbcbe2011-10-12 17:22:43 +0100158 ? ((void)ALOG(LOG_ERROR, LOG_TAG, __VA_ARGS__)) \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800159 : (void)0 )
Steve Blocke7e7fac2011-12-22 15:00:35 +0000160#define ALOGE_IF LOGE_IF
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800161#endif
162
163// ---------------------------------------------------------------------
164
165/*
166 * Conditional based on whether the current LOG_TAG is enabled at
167 * verbose priority.
168 */
169#ifndef IF_LOGV
170#if LOG_NDEBUG
171#define IF_LOGV() if (false)
172#else
Steve Block61fbcbe2011-10-12 17:22:43 +0100173#define IF_LOGV() IF_ALOG(LOG_VERBOSE, LOG_TAG)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800174#endif
Steve Block25a89e72011-10-28 15:36:41 +0100175#define IF_ALOGV IF_LOGV
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800176#endif
177
178/*
179 * Conditional based on whether the current LOG_TAG is enabled at
180 * debug priority.
181 */
182#ifndef IF_LOGD
Steve Block61fbcbe2011-10-12 17:22:43 +0100183#define IF_LOGD() IF_ALOG(LOG_DEBUG, LOG_TAG)
Steve Blocke7e7fac2011-12-22 15:00:35 +0000184#define IF_ALOGD IF_LOGD
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800185#endif
186
187/*
188 * Conditional based on whether the current LOG_TAG is enabled at
189 * info priority.
190 */
191#ifndef IF_LOGI
Steve Block61fbcbe2011-10-12 17:22:43 +0100192#define IF_LOGI() IF_ALOG(LOG_INFO, LOG_TAG)
Steve Blocke7e7fac2011-12-22 15:00:35 +0000193#define IF_ALOGI IF_LOGI
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800194#endif
195
196/*
197 * Conditional based on whether the current LOG_TAG is enabled at
198 * warn priority.
199 */
200#ifndef IF_LOGW
Steve Block61fbcbe2011-10-12 17:22:43 +0100201#define IF_LOGW() IF_ALOG(LOG_WARN, LOG_TAG)
Steve Blocke7e7fac2011-12-22 15:00:35 +0000202#define IF_ALOGW IF_LOGW
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800203#endif
204
205/*
206 * Conditional based on whether the current LOG_TAG is enabled at
207 * error priority.
208 */
209#ifndef IF_LOGE
Steve Block61fbcbe2011-10-12 17:22:43 +0100210#define IF_LOGE() IF_ALOG(LOG_ERROR, LOG_TAG)
Steve Blocke7e7fac2011-12-22 15:00:35 +0000211#define IF_ALOGE IF_LOGE
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800212#endif
213
Joe Onoratoe2bf2ea2010-03-01 09:11:54 -0800214
215// ---------------------------------------------------------------------
216
217/*
218 * Simplified macro to send a verbose system log message using the current LOG_TAG.
219 */
220#ifndef SLOGV
221#if LOG_NDEBUG
222#define SLOGV(...) ((void)0)
223#else
224#define SLOGV(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__))
225#endif
226#endif
227
228#define CONDITION(cond) (__builtin_expect((cond)!=0, 0))
229
230#ifndef SLOGV_IF
231#if LOG_NDEBUG
232#define SLOGV_IF(cond, ...) ((void)0)
233#else
234#define SLOGV_IF(cond, ...) \
235 ( (CONDITION(cond)) \
236 ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \
237 : (void)0 )
238#endif
239#endif
240
241/*
242 * Simplified macro to send a debug system log message using the current LOG_TAG.
243 */
244#ifndef SLOGD
245#define SLOGD(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__))
246#endif
247
248#ifndef SLOGD_IF
249#define SLOGD_IF(cond, ...) \
250 ( (CONDITION(cond)) \
251 ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \
252 : (void)0 )
253#endif
254
255/*
256 * Simplified macro to send an info system log message using the current LOG_TAG.
257 */
258#ifndef SLOGI
259#define SLOGI(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__))
260#endif
261
262#ifndef SLOGI_IF
263#define SLOGI_IF(cond, ...) \
264 ( (CONDITION(cond)) \
265 ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)) \
266 : (void)0 )
267#endif
268
269/*
270 * Simplified macro to send a warning system log message using the current LOG_TAG.
271 */
272#ifndef SLOGW
273#define SLOGW(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__))
274#endif
275
276#ifndef SLOGW_IF
277#define SLOGW_IF(cond, ...) \
278 ( (CONDITION(cond)) \
279 ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) \
280 : (void)0 )
281#endif
282
283/*
284 * Simplified macro to send an error system log message using the current LOG_TAG.
285 */
286#ifndef SLOGE
287#define SLOGE(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__))
288#endif
289
290#ifndef SLOGE_IF
291#define SLOGE_IF(cond, ...) \
292 ( (CONDITION(cond)) \
293 ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)) \
294 : (void)0 )
295#endif
296
297
298
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800299// ---------------------------------------------------------------------
300
301/*
302 * Log a fatal error. If the given condition fails, this stops program
303 * execution like a normal assertion, but also generating the given message.
304 * It is NOT stripped from release builds. Note that the condition test
305 * is -inverted- from the normal assert() semantics.
306 */
Alexandre Elias412514e2011-03-29 16:24:45 -0700307#ifndef LOG_ALWAYS_FATAL_IF
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800308#define LOG_ALWAYS_FATAL_IF(cond, ...) \
309 ( (CONDITION(cond)) \
Chris Pearson19299902010-06-02 16:25:35 -0700310 ? ((void)android_printAssert(#cond, LOG_TAG, ## __VA_ARGS__)) \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800311 : (void)0 )
Alexandre Elias412514e2011-03-29 16:24:45 -0700312#endif
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800313
Alexandre Elias412514e2011-03-29 16:24:45 -0700314#ifndef LOG_ALWAYS_FATAL
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800315#define LOG_ALWAYS_FATAL(...) \
Chris Pearson19299902010-06-02 16:25:35 -0700316 ( ((void)android_printAssert(NULL, LOG_TAG, ## __VA_ARGS__)) )
Alexandre Elias412514e2011-03-29 16:24:45 -0700317#endif
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800318
319/*
320 * Versions of LOG_ALWAYS_FATAL_IF and LOG_ALWAYS_FATAL that
321 * are stripped out of release builds.
322 */
323#if LOG_NDEBUG
324
Alexandre Elias412514e2011-03-29 16:24:45 -0700325#ifndef LOG_FATAL_IF
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800326#define LOG_FATAL_IF(cond, ...) ((void)0)
Alexandre Elias412514e2011-03-29 16:24:45 -0700327#endif
328#ifndef LOG_FATAL
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800329#define LOG_FATAL(...) ((void)0)
Alexandre Elias412514e2011-03-29 16:24:45 -0700330#endif
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800331
332#else
333
Alexandre Elias412514e2011-03-29 16:24:45 -0700334#ifndef LOG_FATAL_IF
Chris Pearson19299902010-06-02 16:25:35 -0700335#define LOG_FATAL_IF(cond, ...) LOG_ALWAYS_FATAL_IF(cond, ## __VA_ARGS__)
Alexandre Elias412514e2011-03-29 16:24:45 -0700336#endif
337#ifndef LOG_FATAL
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800338#define LOG_FATAL(...) LOG_ALWAYS_FATAL(__VA_ARGS__)
Alexandre Elias412514e2011-03-29 16:24:45 -0700339#endif
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800340
341#endif
342
343/*
344 * Assertion that generates a log message when the assertion fails.
345 * Stripped out of release builds. Uses the current LOG_TAG.
346 */
Alexandre Elias412514e2011-03-29 16:24:45 -0700347#ifndef LOG_ASSERT
Chris Pearson19299902010-06-02 16:25:35 -0700348#define LOG_ASSERT(cond, ...) LOG_FATAL_IF(!(cond), ## __VA_ARGS__)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800349//#define LOG_ASSERT(cond) LOG_FATAL_IF(!(cond), "Assertion failed: " #cond)
Steve Blocka9b84a72012-01-09 22:50:36 +0000350#define ALOG_ASSERT LOG_ASSERT
Alexandre Elias412514e2011-03-29 16:24:45 -0700351#endif
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800352
353// ---------------------------------------------------------------------
354
355/*
356 * Basic log message macro.
357 *
358 * Example:
Steve Block61fbcbe2011-10-12 17:22:43 +0100359 * ALOG(LOG_WARN, NULL, "Failed with error %d", errno);
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800360 *
361 * The second argument may be NULL or "" to indicate the "global" tag.
362 */
Steve Block61fbcbe2011-10-12 17:22:43 +0100363#ifndef ALOG
364#define ALOG(priority, tag, ...) \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800365 LOG_PRI(ANDROID_##priority, tag, __VA_ARGS__)
Steve Block61fbcbe2011-10-12 17:22:43 +0100366// Temporary measure for code still using old LOG macros.
367#ifndef LOG
368#define LOG ALOG
369#endif
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800370#endif
371
372/*
373 * Log macro that allows you to specify a number for the priority.
374 */
375#ifndef LOG_PRI
376#define LOG_PRI(priority, tag, ...) \
377 android_printLog(priority, tag, __VA_ARGS__)
378#endif
379
380/*
381 * Log macro that allows you to pass in a varargs ("args" is a va_list).
382 */
383#ifndef LOG_PRI_VA
384#define LOG_PRI_VA(priority, tag, fmt, args) \
385 android_vprintLog(priority, NULL, tag, fmt, args)
386#endif
387
388/*
389 * Conditional given a desired logging priority and tag.
390 */
Steve Block61fbcbe2011-10-12 17:22:43 +0100391#ifndef IF_ALOG
392#define IF_ALOG(priority, tag) \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800393 if (android_testLog(ANDROID_##priority, tag))
Steve Block61fbcbe2011-10-12 17:22:43 +0100394// Temporary measure for code still using old LOG macros.
395#ifndef IF_LOG
396#define IF_LOG IF_ALOG
397#endif
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800398#endif
399
400// ---------------------------------------------------------------------
401
402/*
403 * Event logging.
404 */
405
406/*
407 * Event log entry types. These must match up with the declarations in
408 * java/android/android/util/EventLog.java.
409 */
410typedef enum {
411 EVENT_TYPE_INT = 0,
412 EVENT_TYPE_LONG = 1,
413 EVENT_TYPE_STRING = 2,
414 EVENT_TYPE_LIST = 3,
415} AndroidEventLogType;
416
417
Alexandre Elias412514e2011-03-29 16:24:45 -0700418#ifndef LOG_EVENT_INT
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800419#define LOG_EVENT_INT(_tag, _value) { \
420 int intBuf = _value; \
421 (void) android_btWriteLog(_tag, EVENT_TYPE_INT, &intBuf, \
422 sizeof(intBuf)); \
423 }
Alexandre Elias412514e2011-03-29 16:24:45 -0700424#endif
425#ifndef LOG_EVENT_LONG
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800426#define LOG_EVENT_LONG(_tag, _value) { \
427 long long longBuf = _value; \
428 (void) android_btWriteLog(_tag, EVENT_TYPE_LONG, &longBuf, \
429 sizeof(longBuf)); \
430 }
Alexandre Elias412514e2011-03-29 16:24:45 -0700431#endif
432#ifndef LOG_EVENT_STRING
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800433#define LOG_EVENT_STRING(_tag, _value) \
434 ((void) 0) /* not implemented -- must combine len with string */
Alexandre Elias412514e2011-03-29 16:24:45 -0700435#endif
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800436/* TODO: something for LIST */
437
438/*
439 * ===========================================================================
440 *
441 * The stuff in the rest of this file should not be used directly.
442 */
443
444#define android_printLog(prio, tag, fmt...) \
445 __android_log_print(prio, tag, fmt)
446
447#define android_vprintLog(prio, cond, tag, fmt...) \
448 __android_log_vprint(prio, tag, fmt)
449
Chris Pearson19299902010-06-02 16:25:35 -0700450/* XXX Macros to work around syntax errors in places where format string
451 * arg is not passed to LOG_ASSERT, LOG_ALWAYS_FATAL or LOG_ALWAYS_FATAL_IF
452 * (happens only in debug builds).
453 */
454
455/* Returns 2nd arg. Used to substitute default value if caller's vararg list
456 * is empty.
457 */
458#define __android_second(dummy, second, ...) second
459
460/* If passed multiple args, returns ',' followed by all but 1st arg, otherwise
461 * returns nothing.
462 */
463#define __android_rest(first, ...) , ## __VA_ARGS__
464
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800465#define android_printAssert(cond, tag, fmt...) \
Chris Pearson19299902010-06-02 16:25:35 -0700466 __android_log_assert(cond, tag, \
467 __android_second(0, ## fmt, NULL) __android_rest(fmt))
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800468
469#define android_writeLog(prio, tag, text) \
470 __android_log_write(prio, tag, text)
471
472#define android_bWriteLog(tag, payload, len) \
473 __android_log_bwrite(tag, payload, len)
474#define android_btWriteLog(tag, type, payload, len) \
475 __android_log_btwrite(tag, type, payload, len)
Chris Pearson19299902010-06-02 16:25:35 -0700476
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800477// TODO: remove these prototypes and their users
478#define android_testLog(prio, tag) (1)
479#define android_writevLog(vec,num) do{}while(0)
480#define android_write1Log(str,len) do{}while (0)
481#define android_setMinPriority(tag, prio) do{}while(0)
482//#define android_logToCallback(func) do{}while(0)
483#define android_logToFile(tag, file) (0)
484#define android_logToFd(tag, fd) (0)
485
Joe Onoratoe2bf2ea2010-03-01 09:11:54 -0800486typedef enum {
487 LOG_ID_MAIN = 0,
488 LOG_ID_RADIO = 1,
489 LOG_ID_EVENTS = 2,
490 LOG_ID_SYSTEM = 3,
491
492 LOG_ID_MAX
493} log_id_t;
494
495/*
496 * Send a simple string to the log.
497 */
498int __android_log_buf_write(int bufID, int prio, const char *tag, const char *text);
499int __android_log_buf_print(int bufID, int prio, const char *tag, const char *fmt, ...);
500
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800501
502#ifdef __cplusplus
503}
504#endif
505
506#endif // _LIBS_CUTILS_LOG_H