Replies: 5 comments
-
We are not able to support custom logging for xUnit or an API specific for xUnit from inside Coyote, else we need to do the same for every single framework. (We also do not want to be too opinionated, different xUnit users might want to use variations of a logger. We want to be able to support the most generic scenario and users can specialize from there.) Unless you are thinking something else here, in which case could you elaborate on what that API would look like? The stance Coyote takes is to provide a generic Coyote itself uses xUnit for its regression test suite, and the logging there works without issues today. See base test class here.
As I mentioned offline, an updated Saying the above, I am not sure why your xUnit logger is not printing messages as I am not familiar with your code. Can you elaborate on what kind of messages are you trying to print with an example and how you are printing them? Note that the logger you install to the testing engine of Coyote is only used to capture output that the Coyote engine logs (for task-based programs that means only debug logs on scheduling decisions, no application logs; for actor-based programs it also logs all the actor related events, like sending events and creating actors). If your application has custom log output, then Coyote does not capture that unless you redirect it manually to the same logger that you are installing to the TestingEngine. From inside the application you then need to use that logger (instead of e.g. writing to Console with |
Beta Was this translation helpful? Give feedback.
-
Btw, if curious, the new logging infra is available in this PR #377, but currently requires building Coyote from source. |
Beta Was this translation helpful? Give feedback.
-
@pdeligia Thanks for the comment! The scenario I am looking for is a clean way to emit Coyote debug logs only, and not application specific logs. I'll wait for the upcoming version to try out the functionality. |
Beta Was this translation helpful? Give feedback.
-
Thanks for confirming @suvamM. What you are asking will indeed be available as soon as the new logging infrastructure gets released soon. Capturing debug logs from Coyote to a custom logger was not available today (without hacks that intercept console output), that is why you were unable to see them. |
Beta Was this translation helpful? Give feedback.
-
Looping back to this @suvamM, just FYI that the new logging infrastructure is now merged to the main branch (#377) and will be available in the next release :) |
Beta Was this translation helpful? Give feedback.
-
In its current form, the logging capabilities of Coyote testing when used from within xUnit is quite limited. To get the logging to work, custom solutions need to be implemented (example: make a custom Coyote logger which accepts the xUnit logger, pass this customer logger to the Coyote testing engine, etc), which makes it both time-consuming and is bit of a trial-and-error process (some solutions may not work at all). Setting the
WithVerbosityEnabled
flag does not generate any logs at all.Could you kindly provide a clean API that allows retrieving the Coyote logs, with the appropriate verbosity level, from within xUnit?
Beta Was this translation helpful? Give feedback.
All reactions