logging icon indicating copy to clipboard operation
logging copied to clipboard

Locked file if `writeFileLogging` is used again

Open chrissound opened this issue 6 years ago • 0 comments

{-# LANGUAGE OverloadedStrings #-}
module Main where

import Prelude hiding (log)
import Control.Logging
import Data.Text

main = do
  withFileLogging "test.log" $ do
    log "abc"
    log "abcxyz"
  --- The below never shows up
  withFileLogging "test.log" $ do
    log "test"
    log "testxyz"

The above outputs:

runhaskell Main.hs
Main.hs: openFile: resource busy (file is locked)

And in the test.log there is only:

11:20:28 [INFO] abc
11:20:28 [INFO] abcxyz

chrissound avatar Mar 17 '19 11:03 chrissound