Comments (4)
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.
from coyote.
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 ILogger
interface that users can implement for their own needs and register it to the testing engine. If you have an existing logger in your application, it is easy to convert it to ILogger
as it's based on the System.IO.TextWriter
class of C# and just need to implement this interface.
Coyote itself uses xUnit for its regression test suite, and the logging there works without issues today. See base test class here.
var logger = new TestOutputLogger(this.TestOutput);
var engine = new TestingEngine(configuration, test)
{
Logger = logger
};
As I mentioned offline, an updated ILogger
is scheduled for an upcoming release soon that polishes this experience more, introduces levels of verbosity (including Debug, which currently Coyote does not forward to a custom logger) and introduces a new flag for writing logs to console (currently WithVerbosityEnabled
is forwarding to console if enabled). But that should not affect your current situation.
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 Console.WriteLine(...)
). Like in this sample here. Let me know if this helps.
from coyote.
Btw, if curious, the new logging infra is available in this PR #377, but currently requires building Coyote from source.
from coyote.
@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.
from coyote.
Related Issues (20)
- Documentation describing different exploration strategies? HOT 2
- How to use the latest version? HOT 3
- Rewiring serializes task runs? HOT 9
- document supported/unsupported Task APIs and synchronization primitives
- Rewrite throws NullReferenceException HOT 11
- fix compatibility issue with VS Code coverage and assembly rewriting HOT 3
- include the test method name in the schedule file
- Why does coyote find no bugs in this code? HOT 1
- fix send event logs when actor runtime has terminated
- Question: About Coyote supporting .NET Core HOT 2
- coyote test failure: Could not load file or assembly 'Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. HOT 5
- Deadlock when using SemaphoreSlim HOT 9
- Error: Please provide RewritingOptions.AssemblyPaths HOT 3
- disable periodic deadlock monitor when running in a debugger
- InvalidProgramException while trying coyote on my library. HOT 13
- IAsyncEnumerable with ToArrayAsync System.BadImageFormatException HOT 2
- race in updating coverage report
- Exception when trying to rewrite WPF .NET 6.0 application; unable to find PresentationCore HOT 5
- Potential bug with race condition HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coyote.