module NetSpider.Log
( LogLine,
WriterLoggingM,
runWriterLoggingM,
logDebugW,
logInfoW,
logWarnW,
logErrorW,
spack
) where
import qualified Control.Monad.Logger as Log
import Data.Functor.Identity (Identity, runIdentity)
import Data.Text (Text, pack)
type LogLine = (Log.Loc, Log.LogSource, Log.LogLevel, Log.LogStr)
type WriterLoggingM = Log.WriterLoggingT Identity
runWriterLoggingM :: WriterLoggingM a -> (a, [LogLine])
runWriterLoggingM = runIdentity . Log.runWriterLoggingT
logDebugW :: Text -> WriterLoggingM ()
logDebugW = Log.logDebugN
logInfoW :: Text -> WriterLoggingM ()
logInfoW = Log.logInfoN
logWarnW :: Text -> WriterLoggingM ()
logWarnW = Log.logWarnN
logErrorW :: Text -> WriterLoggingM ()
logErrorW = Log.logErrorN
spack :: Show a => a -> Text
spack = pack . show