如何将Network.Browser.browse的日志静音到stdout?

时间:2010-06-19 08:13:04

标签: networking haskell

我正在使用Network.Browser 4000.0.9来检索网页:

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"

尽管setDebugLog Nothing,但这会引发所有这些日志记录:

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
...

如何关闭此注销?

1 个答案:

答案 0 :(得分:3)

按照您链接的文档页面中的说明使用setOutHandlersetErrHandler