-
Notifications
You must be signed in to change notification settings - Fork 31
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
Log creaper commands in JSON format in debug #154
Conversation
following #153 |
You could have just adjusted #153, but whatever works for you :-) |
Now looking at the 1st comment -- is the JSON format really multiline? |
Not sure, if I understand you correctly. When toJSONString(compact=false) is called, then yes operation is printed "nicely" on multiple lines. |
Ah, I definitely don't want that on DEBUG level. That would be too much of a change. And if I remember correctly, you wanted that JSON for pasting into a |
Ok. I will add then own TRACE level log entry for JSON format. I prefer compact=false, as it is more human-readable and curl is OK with it. |
Ah, OK, thanks. |
Oh crap, I shouldn't have merged just yet :-( What's the difference between log.tracef("JSON format:\n%s", operation.toJSONString(false)); and log.tracef("JSON format:%n%s", operation.getOperation().toJSONString(false)); ? Specifically, I'm thinking about Which one is correct? |
@mchoma bump |
%n is correct, because it is platform independent. Should I send new PR with only that change? |
Yes please. |
Absolutely, thanks. |
Resolves #151
It producelog output as:
INFO: Executing operation /core-service=management/security-realm=creaperSecRealm:add
JSON format:
{
"operation" : "add",
"address" : [
{
"core-service" : "management"
},
{
"security-realm" : "creaperSecRealm"
}
]
}