yav / simple-smt

BSD 3-Clause "New" or "Revised" License
20 stars 20 forks source link

provide a Logger that writes to stderr #15

Open jwaldmann opened 2 years ago

jwaldmann commented 2 years ago

I propose to

newLogger :: Int -> IO Logger    -- keep the type
newLogger = newLoggerH stdout  -- refactor implementation

newLoggerH :: Handle -> Int -> IO Logger -- new function
newLoggerH h l = -- old implementation, with stdout replaced by h
  do tab <- newIORef 0
  ...
jwaldmann commented 2 years ago

https://github.com/yav/simple-smt/commit/3cc737dbe4ad5147fc205eaaf888054835166c71

(not linked automatically since I used the wrong issue number in the commit message)

yav commented 2 years ago

Seems like a good idea! I'd just use something like newLoggerWith or newLoggerWithHandle for the name. Please make a PR, I'd be happy to merge.