-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add more \xxx escapes to printf implementation #7
Comments
I admit I am not even sure if it is a good idea to permit them... |
I might support \ooo or \xhhh escapes, so that people who are using a non-ASCII character set can specify non-ASCII characters if required (not necessarily control characters). |
Thanks for the suggestion! If you'd like to contribute that code, just send me a patch or pull request. If you have no time, I'll most probably do it some time later this week. |
I'm a little unsure what exactly this issue is trying to address. Are you talking about the backslash-escape formatting in __stdlog_sigsafe_printf()? I don't understand why that is even present. If I specify something like:
The compiler translates those escapes; __stdlog_sigsafe_printf() will never see them, so there is no need to have "support" for them in that function. In fact, I would be very surprised if I wrote:
and found that stdlog turned that into a log message like:
I think that is what the existing code does and that section should be removed. Am I missing something? |
IIRC the intent was to actually escape (LF) back to ('','n') so that control characters cannot render the log unreadable. |
We currently support a too-small subset. But before we extend it, we should think if we really want to have control characters inside our log messages (or maybe make this a config option?).
The text was updated successfully, but these errors were encountered: