Skip to content
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

Treat mutli-line parameters correctly #26

Open
Gaibhne opened this issue Apr 28, 2023 · 1 comment
Open

Treat mutli-line parameters correctly #26

Gaibhne opened this issue Apr 28, 2023 · 1 comment

Comments

@Gaibhne
Copy link

Gaibhne commented Apr 28, 2023

I think the following is a common use case of how people want their config files to look:

log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                  '$status $body_bytes_sent "$http_referer" '
                  '"$http_user_agent" "$http_x_forwarded_for"';

After running the formatter, neither outcome looks appealing to me:

With -a/--align:

log_format           main '$remote_addr - $remote_user [$time_local] "$request" '
'$status             $body_bytes_sent "$http_referer" '
'"$http_user_agent"  "$http_x_forwarded_for"';

Without -a/--align:

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
@Gaibhne
Copy link
Author

Gaibhne commented Apr 28, 2023

Come to think about it, I think the -a variant is even actually a bug: it's inserting additional spaces/tabs in the log format string, which I would think would lead to the logs looking differently after formatting the config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant