Skip to content

Commit 510c407

Browse files
committed
Unify logging styles of LOGD and LOGV
We now only include source file name and line number for LOGD.
1 parent 4b8f069 commit 510c407

3 files changed

Lines changed: 12 additions & 9 deletions

File tree

daemon/src/main/jni/logging.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,12 @@
3636
#define LOGE(...) 0
3737
#else
3838
#ifndef NDEBUG
39-
#define LOGD(fmt, ...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, "%s:%d#%s" ": " fmt, __FILE_NAME__, __LINE__, __PRETTY_FUNCTION__ __VA_OPT__(,) __VA_ARGS__)
40-
#define LOGV(fmt, ...) __android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, "%s:%d#%s" ": " fmt, __FILE_NAME__, __LINE__, __PRETTY_FUNCTION__ __VA_OPT__(,) __VA_ARGS__)
39+
#define LOGD(fmt, ...) \
40+
__android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, \
41+
"%s:%d#%s" \
42+
": " fmt, \
43+
__FILE_NAME__, __LINE__, __PRETTY_FUNCTION__ __VA_OPT__(, ) __VA_ARGS__)
44+
#define LOGV(...) __android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)
4145
#else
4246
#define LOGD(...) 0
4347
#define LOGV(...) 0

dex2oat/src/main/cpp/include/logging.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
#define LOGE(...) 0
1616
#else
1717
#ifndef NDEBUG
18-
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
19-
#define LOGV(fmt, ...) \
20-
__android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, \
18+
#define LOGD(fmt, ...) \
19+
__android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, \
2120
"%s:%d#%s" \
2221
": " fmt, \
2322
__FILE_NAME__, __LINE__, __PRETTY_FUNCTION__ __VA_OPT__(, ) __VA_ARGS__)
23+
#define LOGV(...) __android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)
2424
#else
2525
#define LOGD(...) 0
2626
#define LOGV(...) 0

native/include/common/logging.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,13 @@ inline void LogToAndroid(int prio, const char *tag, fmt::format_string<T...> fmt
7777
} // namespace vector::native::detail
7878

7979
#ifndef NDEBUG
80-
#define LOGV(fmt, ...) \
81-
::vector::native::detail::LogToAndroid(ANDROID_LOG_VERBOSE, LOG_TAG, "{}:{} ({}): " fmt, \
82-
__FILE_NAME__, __LINE__, \
83-
__PRETTY_FUNCTION__ __VA_OPT__(, ) __VA_ARGS__)
8480
#define LOGD(fmt, ...) \
8581
::vector::native::detail::LogToAndroid(ANDROID_LOG_DEBUG, LOG_TAG, "{}:{} ({}): " fmt, \
8682
__FILE_NAME__, __LINE__, \
8783
__PRETTY_FUNCTION__ __VA_OPT__(, ) __VA_ARGS__)
84+
#define LOGV(fmt, ...) \
85+
::vector::native::detail::LogToAndroid(ANDROID_LOG_VERBOSE, LOG_TAG, \
86+
fmt __VA_OPT__(, ) __VA_ARGS__)
8887
#else
8988
#define LOGV(...) ((void)0)
9089
#define LOGD(...) ((void)0)

0 commit comments

Comments
 (0)