-
Notifications
You must be signed in to change notification settings - Fork 102
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
Allow pcn_log to be split in multiple lines #55
Allow pcn_log to be split in multiple lines #55
Conversation
771dd49
to
482fca5
Compare
Not clear to me how it could be used. I suggest to add a brief comment in the documentation saying how to split the content over multiple lines, and also that this practice should be really avoided because it affects the capability to parse the output log with another program (which may expect one log per line). |
@frisso you're right, the text present on a logging primitive should be in a single line, your reason is a valid one and there is another one, it can be difficult to look for a error string in the code if this is broken into multiple lines. However this is not the goal of this PR, the goal is to allow splitting the call of a now:
after this PR:
This is weird but the second case is not supported currently as described in #1. |
Got it, Mauricio, thank you very much. |
I tested it and it works pretty good, there is just one case it doesn't cover (was also not covered on previous version)
Would you mind applying the next diff to also supporting it? Thanks so much for the PR.
|
482fca5
to
39f86a9
Compare
This commit fixes a "bug" in the pcn_log function that did not allow to split the pcn_log body into multiple lines, for example by putting the text and the parameters in different lines. It uses an improved regex function to check the end of the pcn_log function and replace it with the correct version so that compilation errors can be avoided. Fixes: polycube-network#1 (pcn_log cannot be split in multiple lines) Signed-off-by: Sebastiano Miano <mianosebastiano@gmail.com>
39f86a9
to
1fa9d1d
Compare
Thanks for the clarification @mauriciovasquezbernal. |
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.
LGTM! Thanks Sebastiano.
This commit fixes a "bug" in the
pcn_log
function that did not allow to split thepcn_log
body into multiple lines.It uses an improved regex function to check the end of the function and replace it with the correct version so that compilation errors can be avoided.
This PR solves the issue #1 reported by @mauriciovasquezbernal.