我正在使用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
...
如何关闭此注销?
答案 0 :(得分:3)
按照您链接的文档页面中的说明使用setOutHandler
和setErrHandler
。