问题
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