logd.h revision 4f6e8d7a00cbeda1e70cc15be9c4af1018bdad53
1/*
2 * Copyright (C) 2006 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#ifndef _ANDROID_CUTILS_LOGD_H
18#define _ANDROID_CUTILS_LOGD_H
19
20#include <time.h>
21#include <stdio.h>
22#include <unistd.h>
23#include <stdint.h>
24#include <sys/types.h>
25#ifdef HAVE_PTHREADS
26#include <pthread.h>
27#endif
28#include <cutils/uio.h>
29#include <stdarg.h>
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/*
36 * Priority values, in ascending priority order.
37 */
38typedef enum android_LogPriority {
39    ANDROID_LOG_UNKNOWN = 0,
40    ANDROID_LOG_DEFAULT,    /* only for SetMinPriority() */
41    ANDROID_LOG_VERBOSE,
42    ANDROID_LOG_DEBUG,
43    ANDROID_LOG_INFO,
44    ANDROID_LOG_WARN,
45    ANDROID_LOG_ERROR,
46    ANDROID_LOG_FATAL,
47    ANDROID_LOG_SILENT,     /* only for SetMinPriority(); must be last */
48} android_LogPriority;
49
50int __android_log_write(int prio, const char *tag, const char *text);
51
52int __android_log_vprint(int prio, const char *tag,
53			 const char *fmt, va_list ap);
54
55int __android_log_bwrite(int32_t tag, const void *payload, size_t len);
56int __android_log_btwrite(int32_t tag, char type, const void *payload,
57    size_t len);
58
59int __android_log_print(int prio, const char *tag,  const char *fmt, ...)
60#if defined(__GNUC__)
61    __attribute__ ((format(printf, 3, 4)))
62#endif
63    ;
64
65
66void __android_log_assert(const char *cond, const char *tag,
67			  const char *fmt, ...)
68#if defined(__GNUC__)
69    __attribute__ ((noreturn))
70    __attribute__ ((format(printf, 3, 4)))
71#endif
72    ;
73
74#ifdef __cplusplus
75}
76#endif
77
78#endif /* _LOGD_H */
79