-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
json log format #115
json log format #115
Conversation
include/triton/common/triton_json.h
Outdated
WriteBuffer, rapidjson::UTF8<>, rapidjson::UTF8<>, | ||
rapidjson::CrtAllocator, writeFlags> | ||
writer(writebuffer); | ||
writer.String(input.c_str()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going to ask if this can fail if the input has some malformed or half-formed JSON in it, but it seems like it won't: Tencent/rapidjson#1767 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error handling was a little tricky w.r.t to we usually log an error - so I didn't want to create a recursion by accident. Writing and error causes an error .... so would probably have to fail silently ... or print directly to the stdout ...
@@ -125,7 +129,10 @@ class Logger { | |||
// Flush the log. | |||
void Flush(); | |||
|
|||
static const std::array<const char*, Level::kINFO + 1> LEVEL_NAMES; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should have defined Level:kEND
then use it instead of Level::kINFO + 1
, easy to miss if someone adds new log level and doesn't change there.
continued in new PR |
No description provided.