开发者

How do I silence Network.Browser.browse's logs to stdout?

I'm using Network.Browser 400开发者_高级运维0.0.9 to retrieve a web page:

import Network.Browser
import Network.HTTP

main =
  do
    (uri, response) <- browse $ do
      setAllowRedirects True
      setDebugLog Nothing
      request $ getRequest "http://www.google.com/robots.txt"
    putStrLn "done"

Despite setDebugLog Nothing this spews all of this logging:

Sending:
GET /robots.txt HTTP/1.1
Host: www.google.com
User-Agent: ...
Content-Length: 0


Creating new connection to www.google.com
Received:
HTTP/1.1 200 OK
Content-Type: text/plain
...

How do I turn this logging off?


Use setOutHandler and setErrHandler as described in the documentation page you linked.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜