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] Enable logging #53

Open
BennyAlex opened this issue Jul 14, 2020 · 4 comments
Open

[Feature Request] Enable logging #53

BennyAlex opened this issue Jul 14, 2020 · 4 comments

Comments

@BennyAlex
Copy link

BennyAlex commented Jul 14, 2020

Hey @muratcorlu
It would be nice if you could turn on logging, displaying informations like the request's url and what happend with it (json file loaded/ forwarded because no mock was found etc)

@BennyAlex BennyAlex changed the title [Feature Request] Add loging [Feature Request] Enable logging Jul 14, 2020
@muratcorlu
Copy link
Owner

Do you think current logging functionality is not enough or you didn't notice it? https://github.com/muratcorlu/connect-api-mocker#logging

@BennyAlex
Copy link
Author

@muratcorlu
didnt saw it. But it only logs if a mock file was found, for forwarded requests it would be also nice to see an information :)

@muratcorlu
Copy link
Owner

Actually connect-api-mocker doesn't forward requests, just pass to the next middleware. So if you have another middleware that handles same url to go to real api it will be forwarded. But a convenient log message could be put to that line https://github.com/muratcorlu/connect-api-mocker/blob/master/index.js#L158 . Maybe something like Couldn't find a mock for this url. Request passing to next middleware. Is this what you mean?

@BennyAlex
Copy link
Author

@muratcorlu
yes, display Couldn't find a mock for this url. and Request passing to next middleware. if also nextOnNotFound is set to true.

Thanks.

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

2 participants