kazu-yamamoto / logger

A fast logging system for Haskell
159 stars 68 forks source link

When I log a message longer than 8160 characters, fast-logger just logs a newline #80

Closed nh2 closed 8 years ago

nh2 commented 8 years ago
import qualified Data.Text as T
import           System.Log.FastLogger

main :: IO ()
main = do
  set <- newStderrLoggerSet defaultBufSize
  let text = T.pack $ replicate 8161 'x'
  pushLogStrLn set (toLogStr text)

Expected output: lots of xs

Actual output: (enclused in 2 horizontal bars for better visibility)



Fix attached (props to @exFalso and @chpatrick for helping), and a test.

Independent of this, I also noticed that when logging that string, in toBufIOWith there comes around a Done with len == 0 as the first thing before the real data comes; I didn't look into why that is.

kazu-yamamoto commented 8 years ago

I have merged this pull request. Thank you very much.

Please register the issue above as a new issue.

kazu-yamamoto commented 8 years ago

A new version has been released.

nh2 commented 8 years ago

Thanks you!