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

Feature Request: Optionally disable use of the log crate #215

Closed
pdtilton opened this issue Nov 8, 2016 · 6 comments
Closed

Feature Request: Optionally disable use of the log crate #215

pdtilton opened this issue Nov 8, 2016 · 6 comments

Comments

@pdtilton
Copy link

pdtilton commented Nov 8, 2016

I am interested in using postgres as a logging backend in conjunction with the log crate. The issue is that anytime such a logger creates a query it results in infinite recursion due to the use of the debug! and info! log macros in src/lib.rs. Would it be possible to optionally disable this feature in rust-postgres? I'm fairly new to Rust, so perhaps there is a workaround I am not considering instead.

@sfackler
Copy link
Owner

sfackler commented Nov 8, 2016

Haha, that's something I haven't thought of! Seems like a reasonable way to fix this would be to add a feature to disable logging.

@pdtilton
Copy link
Author

pdtilton commented Nov 8, 2016

Wow! That was fast. I was just looking into approaches to tackle the issue. Thank you very much, sir!

@stevenliebregt
Copy link

It seems this no longer exists in the current version, is it possible to bring this back?

@sfackler
Copy link
Owner

I think a pluggable trait would be the preferred way to go here, like what's discussed in #1053.

@stevenliebregt
Copy link

Is there any progress in that PR, or could I propose a quick feature based solution in the meantime? I'm using this crate in an FFI context with Node, and with large queries it keeps crashing the processes because rust expects stdout to be blocking, and node doesn't. Simply setting the node stdout to blocking isn't a great solution as it might block the node event loop as well.

@sfackler
Copy link
Owner

sfackler commented Dec 4, 2023

You could not log to stdout when running in an FFI context with Node.

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

3 participants