I\'m attempting to use HSlogger to get some information about my program. So I add the following line to my function
import Data.Word
import qualified Data.Byte
Disclaimer: I'm the author of the Logger Haskell framework.
Although McCann's answer is greatly detailed, it does not tell, that Haskell was lacking a general purpose logging framework at the time the question was asked. The HSLogger is a standard now, but it provides very basic logging functionality while being slow and not extensible. To be clear, here are some defects of HSLogger:
WriterT
or other solutions not to mess your code.That being said I would love to introduce the Logger Haskell framework. It allows for efficient & extensible logging, including:
WriterT
monad)TemplateHaskell
interface allowing logging additional details, like file numbers or module namesBaseLogger
, which cannot do anything sensible. To be clear - the filtering functionality is created in less than 20 lines as a logger-transformer and you can define your own transformers. How to do it is described in the documentation.But the library is pretty new, so it can lack some needed functionality. The good information is, that you can create this functionality easily by yourself or help us improve it by reporting issues on GitHub.
The logger is developed internally by the company I'm working at (luna-lang.org) and is used inside a compiler we are creating.