-
Notifications
You must be signed in to change notification settings - Fork 92
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 Enhancement] - v10.x - Support logging to file #341
Comments
Hi @judimator , thanks for reporting the issue. After a quick look at pact-reference and pact-php (version 10 alpha) projects, I think:
cc @YOU54F Thanks for the useful code . Do you know how pact's implementation in other languages handle this one? |
Hey, Pact-JS doesn't support logging to file at the moment ( I made a draft PR here pact-foundation/pact-js-core#428) The current interface between the ffi for init'ing with the logger is here https://github.com/pact-foundation/pact-js-core/blob/master/native/ffi.cc#L12 There are some convenience functions to setup a logger https://docs.rs/pact_ffi/latest/pact_ffi/log/index.html
I believe these call logger_apply, where as calling I did notice that once you've called Further examples |
in my pr for pact python i tried this out to set the log level at init time, depending on the env vars presented by the user instructions so it can easily be controlled externally to dump to a file, buffer etc or set a log level. that code shown only sets up one logger sink though, so if your code relies on pulling anything back from a log buffer and it’s instead been setup with a file or stdout, the data won’t be present. it will probably be implemented differently in the end but might be worth sharing :) |
Implemented in #689, will be available in v10.1
|
Hi there,
During my work I found the following issue
Env:
Step to reproduce:
Expected result:
The file exists
Actual result:
The file not found
The text was updated successfully, but these errors were encountered: