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

Consider introducing logging abstraction? #80

Closed
haf opened this issue Apr 6, 2015 · 5 comments
Closed

Consider introducing logging abstraction? #80

haf opened this issue Apr 6, 2015 · 5 comments

Comments

@haf
Copy link
Owner

haf commented Apr 6, 2015

I'm finding myself wanting it to log to the programmer about decisions I'm making based on the body passed. For example; if a Form body is passed, it makes sense to ignore a missing Content-Type, and it makes sense to choose x-urlencoded or form-data over anything that's in the Content-Type header.

I would like to make the library tell this to the user, somehow.

If you want I can add the logging abstraction I used for logibit.hawk; it's an iteration I've used in about 7 different libraries so far, so I can say it covers almost all the ground needed for logging.

@relentless
Copy link
Collaborator

It would be good to make such decisions available (although I suspect the vast majority of users wouldn't be too interested).

How would this look, I mean how would the caller access the log?

@haf
Copy link
Owner Author

haf commented Apr 6, 2015

There's no log to access; the library has a callback/interface which can be replaced to facilitate logging. See e.g. at the bottom of this page: http://suave.io/ or https://logary.github.io/adapters/eventstore/ or for how an adapter is written for a logging framework: https://github.com/logary/logary/blob/master/src/adapters/Logary.Adapters.Hawk/Hawk.Logary.fs

@relentless
Copy link
Collaborator

Got you. Yes, looks nice, would fit in quite well.

@haf
Copy link
Owner Author

haf commented Apr 6, 2015

Great, I'll throw it in for free ;)

@haf
Copy link
Owner Author

haf commented May 24, 2015

Ok, got one in there now. I haven't exposed it fully yet.

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