diff options
author | Ken Sumrall <ksumrall@android.com> | 2013-04-03 13:43:11 -0700 |
---|---|---|
committer | Ken Sumrall <ksumrall@android.com> | 2013-04-11 20:03:47 -0700 |
commit | 7425fd1b231fcdb3c260877a13f794a0c7361e80 (patch) | |
tree | 0c54939f1e54f23821ba305c093435fc620f73a8 /include | |
parent | c796ed97466510dd5239008554decbe72825e19c (diff) | |
download | system_core-7425fd1b231fcdb3c260877a13f794a0c7361e80.zip system_core-7425fd1b231fcdb3c260877a13f794a0c7361e80.tar.gz system_core-7425fd1b231fcdb3c260877a13f794a0c7361e80.tar.bz2 |
klog: Have klog_write() call klog_init() if needed
Also change klog_init() to do nothing if already initialized.
Change-Id: Ia2dfe914c9d9fd119fb8939508d57b15c9884663
Diffstat (limited to 'include')
-rw-r--r-- | include/cutils/klog.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/cutils/klog.h b/include/cutils/klog.h index 1335543..ba728ac 100644 --- a/include/cutils/klog.h +++ b/include/cutils/klog.h @@ -17,12 +17,18 @@ #ifndef _CUTILS_KLOG_H_ #define _CUTILS_KLOG_H_ +#include <sys/cdefs.h> + +__BEGIN_DECLS + void klog_init(void); void klog_set_level(int level); void klog_close(void); void klog_write(int level, const char *fmt, ...) __attribute__ ((format(printf, 2, 3))); +__END_DECLS + #define KLOG_ERROR(tag,x...) klog_write(3, "<3>" tag ": " x) #define KLOG_WARNING(tag,x...) klog_write(4, "<4>" tag ": " x) #define KLOG_NOTICE(tag,x...) klog_write(5, "<5>" tag ": " x) |