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

Log integration #18

Open
nomeata opened this issue Nov 16, 2016 · 2 comments
Open

Log integration #18

nomeata opened this issue Nov 16, 2016 · 2 comments

Comments

@nomeata
Copy link

nomeata commented Nov 16, 2016

I’m using websockets-snap to integrate a websockets app into my snap server, and I am stuck finding out how to use snap’s logging facilities from the websockets code, and the websockets-snap documentation does not provide anything here. Is it possible to write to the error.log from the websockets handler?

@jaspervdj-luminal
Copy link

I don't think there is a way to do this. Snap provides: logError :: MonadSnap m => ByteString -> m (). What we would need, however, is something like getLogError :: MonadSnap m => m (ByteString -> IO ()). That way we could get the logger and pass it down. Do you think Snap could provide such a thing @mightybyte?

@mightybyte
Copy link

You definitely can't use Snap.Core.logError. However you can drop down to System.FastLogger which is provided by snap-server. I personally use an external logging library katip for my apps. YMMV.

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

3 participants