From c3e81ca853a067d8a809a0ff708821876ee5e4c5 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Fri, 22 Jun 2018 17:32:36 +0900 Subject: [PATCH] Modify printing dlog messages - Use basename() Change-Id: Id08134528685a69de798e1584f056f2f9685fb0b Signed-off-by: Hwankyu Jhun --- idlc/c_gen/c_body_gen_base_cb.h | 8 ++++---- idlc/c_gen/c_gen_base_cb.h | 1 + idlc/cpp_gen/cpp_gen_base_cb.h | 8 ++++---- idlc/cpp_gen/cpp_stub_body_gen.cc | 1 + 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/idlc/c_gen/c_body_gen_base_cb.h b/idlc/c_gen/c_body_gen_base_cb.h index 7fe8c84..647e090 100644 --- a/idlc/c_gen/c_body_gen_base_cb.h +++ b/idlc/c_gen/c_body_gen_base_cb.h @@ -414,10 +414,10 @@ R"__c_cb( #undef _D #endif -#define _E(fmt, ...) dlog_print(DLOG_ERROR, LOG_TAG, "%s: %s(%d) > "fmt, __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__) -#define _W(fmt, ...) dlog_print(DLOG_WARN, LOG_TAG, "%s: %s(%d) > "fmt, __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__) -#define _I(fmt, ...) dlog_print(DLOG_INFO, LOG_TAG, "%s: %s(%d) > "fmt, __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__) -#define _D(fmt, ...) dlog_print(DLOG_DEBUG, LOG_TAG, "%s: %s(%d) > "fmt, __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__) +#define _E(fmt, ...) dlog_print(DLOG_ERROR, LOG_TAG, "%s: %s(%d) > "fmt, basename(__FILE__), __FUNCTION__, __LINE__, ##__VA_ARGS__) +#define _W(fmt, ...) dlog_print(DLOG_WARN, LOG_TAG, "%s: %s(%d) > "fmt, basename(__FILE__), __FUNCTION__, __LINE__, ##__VA_ARGS__) +#define _I(fmt, ...) dlog_print(DLOG_INFO, LOG_TAG, "%s: %s(%d) > "fmt, basename(__FILE__), __FUNCTION__, __LINE__, ##__VA_ARGS__) +#define _D(fmt, ...) dlog_print(DLOG_DEBUG, LOG_TAG, "%s: %s(%d) > "fmt, basename(__FILE__), __FUNCTION__, __LINE__, ##__VA_ARGS__) )__c_cb"; #endif // IDLC_C_GEN_C_BODY_GEN_BASE_CB_H_ diff --git a/idlc/c_gen/c_gen_base_cb.h b/idlc/c_gen/c_gen_base_cb.h index dd51c2a..91449ab 100644 --- a/idlc/c_gen/c_gen_base_cb.h +++ b/idlc/c_gen/c_gen_base_cb.h @@ -48,6 +48,7 @@ R"__c_cb( #include #include #include +#include #include #include #include diff --git a/idlc/cpp_gen/cpp_gen_base_cb.h b/idlc/cpp_gen/cpp_gen_base_cb.h index 8322d0b..2d01c9e 100644 --- a/idlc/cpp_gen/cpp_gen_base_cb.h +++ b/idlc/cpp_gen/cpp_gen_base_cb.h @@ -240,10 +240,10 @@ R"__cpp_cb( #undef _D #endif -#define _E(fmt, ...) dlog_print(DLOG_ERROR, LOG_TAG, "%s: %s(%d) > " fmt, __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__) -#define _W(fmt, ...) dlog_print(DLOG_WARN, LOG_TAG, "%s: %s(%d) > " fmt, __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__) -#define _I(fmt, ...) dlog_print(DLOG_INFO, LOG_TAG, "%s: %s(%d) > " fmt, __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__) -#define _D(fmt, ...) dlog_print(DLOG_DEBUG, LOG_TAG, "%s: %s(%d) > " fmt, __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__) +#define _E(fmt, ...) dlog_print(DLOG_ERROR, LOG_TAG, "%s: %s(%d) > " fmt, basename(__FILE__), __FUNCTION__, __LINE__, ##__VA_ARGS__) +#define _W(fmt, ...) dlog_print(DLOG_WARN, LOG_TAG, "%s: %s(%d) > " fmt, basename(__FILE__), __FUNCTION__, __LINE__, ##__VA_ARGS__) +#define _I(fmt, ...) dlog_print(DLOG_INFO, LOG_TAG, "%s: %s(%d) > " fmt, basename(__FILE__), __FUNCTION__, __LINE__, ##__VA_ARGS__) +#define _D(fmt, ...) dlog_print(DLOG_DEBUG, LOG_TAG, "%s: %s(%d) > " fmt, basename(__FILE__), __FUNCTION__, __LINE__, ##__VA_ARGS__) )__cpp_cb"; #endif // IDLC_CPP_GEN_CPP_GEN_BASE_CB_H_ diff --git a/idlc/cpp_gen/cpp_stub_body_gen.cc b/idlc/cpp_gen/cpp_stub_body_gen.cc index 1d48b7d..8ebf7de 100644 --- a/idlc/cpp_gen/cpp_stub_body_gen.cc +++ b/idlc/cpp_gen/cpp_stub_body_gen.cc @@ -37,6 +37,7 @@ void CppStubBodyGen::OnInitGen(std::ofstream& stream) { stream << NLine(1); stream << "#include " << NLine(1) << "#include " << NLine(1) + << "#include " << NLine(1) << "#include " << NLine(1) << NLine(1) << "#include \"" << header_file << "\"" << NLine(2); -- 2.7.4