friendsofgo / killgrave

Simple way to generate mock servers written in Go

Home Page:https://friendsofgo.github.io/killgrave/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I would like to see the incoming requests dump into stdout

pafuent opened this issue · comments

I would like to have a way to configure, per imposter, if the incoming requests should be dumped to stdout or not.
Also would be nice to have a command line option to override all imposters dump configurations.

Hey @pafuent, thanks for creating the issue, I think something like this could be really helpful and benefitial for Killgrave users.

So, before diving into code implementations, could you bring a bit more information about what's your specific use case and/or what are you exactly trying to solve by adding this feature?

There's no issue yet, but we discussed adding a verbose (-v/--verbose) configuration option with @aperezg in the past which would basically cover your use case (if I understood it correctly) and bring some additional information to the user. So, I'm wondering whether it does worth to add this feature as a separated option or not.

Thanks!! 🙌🏻

Well the concrete use case that I'm trying to solve is related to logging. I needed to test locally the implementation of a logging proxy that will send the logs that receive to a multiple destinations. One of them is Splunk, so instead of deploying a local instance, I used killgrave to simulate it. But then I needed to validate that some tweaks made to the incoming log were sent properly to Splunk. And in my case, it's far more easy to just grep the output of killgrave than checking that in a full fledged Splunk instance.
As you mention, a verbose flag would solve my use case. I also like the idea of the multiple levels, because in my case the imposters that matched is not valuable, so if I can skip those it will be better.
Let me know if you have a PR already for that, if that isn't the case, I would be glad to implement it in my PR.

Gotcha! Thanks for the explanation! 🙏🏻 Sounds like a really good usage case for Killgrave 🙌🏻

Let me know if you have a PR already for that, if that isn't the case, I would be glad to implement it in my PR.

There's no PR neither an actual design, so feel free to either suggest your idea on the issue (which levels and what information will be logged for each) or to redo the existing pull request in a sense it introduces a basic implementation of the "verbose" flag that could be evolved in the near future.

Sure, I'll try to came up with something and update my PR accordingly.