Yesod logInfo no output

吃可爱长大的小学妹 提交于 2019-12-23 12:34:07

问题


I am not getting any output from $logInfo in Yesod.

I have a scaffolded site and when I run yesod devel, I see no output from the log lines I put in my application. I also tried building the application (with cabal) and running from the command line, but still, no output.

I was under the impression that in development mode, all log levels are output.

What am I doing wrong?

UPDATE

I built a "fresh" application using the latest version of Yesod (downloaded with cabal just now). I modified getHomeR in Home.hs as follows:

getHomeR :: Handler Html
    getHomeR = do
        $(logInfo) "Greeting from getHomeR"
        (formWidget, formEnctype) <- generateFormPost sampleForm
        let submission = Nothing :: Maybe (FileInfo, Text)
            handlerName = "getHomeR" :: Text
        defaultLayout $ do
            aDomId <- newIdent
            setTitle "Welcome To Yesod!"
            $(widgetFile "homepage")

I then ran cabal install && yesod devel. I connected to localhost:3000 from my browser. I expected to see Greeting from getHomeR in the console output but it was not there.

I am running the latest Haskell platform (2013.2.0.0) installed from Homebrew on OS X Mavericks.


回答1:


@PaulRouse's answer worked. I changed the defaultBufSize to 1 and started getting log output.



来源:https://stackoverflow.com/questions/20870699/yesod-loginfo-no-output

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!