haskell-hvr / hslogger

Logging framework for Haskell
https://hackage.haskell.org/package/hslogger
BSD 3-Clause "New" or "Revised" License
64 stars 36 forks source link

Adds removeHandler utility function #14

Closed JLimperg closed 10 years ago

JLimperg commented 11 years ago

Greetings!

This pull request adds the function

System.Log.Logger.removeHandler :: Logger -> Logger

It removes the handler that was last added to a logger and can therefore be used to undo a call to addHandler. The main practical advantage is that removeHandler can be used to completely silence the logging system by removing the default handler from the root logger, which should come in handy for programs that implement something like a -qq option.

(By the way, the commit description mentions removeLastHandler instead of removeHandler because I forgot to update it after a rebase. Sorry about that.)