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

Provide more logging macros #47

Open
f5yacobucci opened this issue Sep 1, 2023 · 1 comment · May be fixed by #94
Open

Provide more logging macros #47

f5yacobucci opened this issue Sep 1, 2023 · 1 comment · May be fixed by #94

Comments

@f5yacobucci
Copy link
Contributor

ngx-rust doesn't provide a full set of convenience macros for logging.

We support specific debug logging, but for other logging the user still needs to call the C FFI functions themselves. Needing to provide unnecessary arguments, e.g., in the upstream.rs module example:

ngx_conf_log_error(
            NGX_LOG_EMERG as usize,
            cf,
            0,
            "CUSTOM UPSTREAM no upstream srv_conf".as_bytes().as_ptr() as *const i8,
       );

This can be simplified with a corresponding macro like we do for ngx_log_debug!.

@jmccl
Copy link
Contributor

jmccl commented May 12, 2024

As an aside 'eprintln!' goes to the error log which is pretty useful, although not what you're proposing.

@bavshin-f5 bavshin-f5 linked a pull request Oct 25, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants