Skip to content

Commit

Permalink
updated based on review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nnshah1 committed May 15, 2024
1 parent 47fd5ee commit 2ca8f28
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions include/triton/backend/backend_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,15 @@ namespace triton { namespace backend {
("failed to log message: ")); \
} while (false)

#define LOG_JSON_MESSAGE(LEVEL, PREAMBLE, MSG) \
do { \
LOG_IF_ERROR( \
TRITONSERVER_LogJsonMessage(LEVEL, __FILE__, __LINE__, PREAMBLE, MSG), \
("failed to log JSON message: ")); \
#define LOG_SERVER_MESSAGE(LEVEL, HEADING, MSG) \
do { \
LOG_IF_ERROR( \
TRITONSERVER_LogServerMessage( \
LEVEL, __FILE__, __LINE__, HEADING, MSG), \
("failed to log message: ")); \
} while (false)

#define LOG_JSON_VALUE(LEVEL, PREAMBLE, VALUE) \
#define LOG_JSON_VALUE(LEVEL, HEADING, VALUE) \
do { \
const char* error_message = "failed to log JSON message: "; \
triton::common::TritonJson::WriteBuffer buffer; \
Expand All @@ -96,8 +97,8 @@ namespace triton { namespace backend {
&message, buffer.Contents().c_str(), buffer.Contents().length()), \
error_message); \
LOG_IF_ERROR( \
TRITONSERVER_LogJsonMessage( \
TRITONSERVER_LOG_INFO, __FILE__, __LINE__, PREAMBLE, message), \
TRITONSERVER_LogServerMessage( \
TRITONSERVER_LOG_INFO, __FILE__, __LINE__, HEADING, message), \
(error_message)); \
LOG_IF_ERROR(TRITONSERVER_MessageDelete(message), (error_message)); \
} while (false)
Expand Down

0 comments on commit 2ca8f28

Please sign in to comment.