mocktools / go-smtp-mock

SMTP mock server written on Golang. Mimic any 📤 SMTP server behavior for your test environment with fake SMTP server.
MIT License
128 stars 18 forks source link

[FEATURE] Logging to testing logger #171

Open mitar opened 8 months ago

mitar commented 8 months ago

New feature request checklist

Feature description

Currently this package supports logging to stdout. Which works well, but I think inside unit test it would be even better if it would support logging to testing.Logf. Then it is easier to see chronological order of logging messages, when other parts of your unit test are using testing.Logf. They are also shown only if the test fails.

I think API could be an option to ConfigurationAttr, something like LogToTesting *testing.T and you would pass *testing.T instance to it.

Alternative would be that I could pass my own "logger" instance and then I could make my own adapter.

bestwebua commented 8 months ago

@mitar I'll take for develop this feature next week.