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

taking verbose = false serious #294

Closed
SimonDanisch opened this issue Sep 11, 2018 · 0 comments
Closed

taking verbose = false serious #294

SimonDanisch opened this issue Sep 11, 2018 · 0 comments

Comments

@SimonDanisch
Copy link
Contributor

Julia 1.0
HTTP.jl v0.6.14

I need to run an HTTP server in an environment where I should not print!
I have some code like this:

handler = HTTP.HandlerFunction(handler_func)
server = HTTP.Server(handler)
server_task = @async (ret = HTTP.serve(server, verbose = false))
tcpref = Ref{Sockets.TCPServer}()
# Start HTTP listen server on port $port_HTTP"
ws_task = @async HTTP.listen(
        baseurl, ws_port, tcpref = tcpref, verbose = false
    ) do s
    is_upgrade(s.message) && upgrade(websocket_handler, s)
end

verbose = false gets me a bit further, but still prints plenty.
I thought maybe I can just set logger = devnull, but that gets me some pretty flaky behavior.
Not sure what exactly happens, but seems like sometimes the server doesn't really start (kind of hard to tell, since now it isn't printing anything anymore :P)

So I guess my question is, why isn't verbose = false just turning off all output - and should it?

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