{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeOperators #-}
module Network.Ipfs.Api.Log where
import Control.Monad.IO.Class (MonadIO)
import Data.Text (Text)
import Network.Ipfs.Api.Internal (_logLevel, _logLs)
import Network.Ipfs.Api.Internal.Call (call, streamCall)
import Network.Ipfs.Api.Internal.Stream (_logTail)
import Network.Ipfs.Api.Types (LogLevelObj, LogLsObj)
import Network.Ipfs.Client (IpfsT)
level :: MonadIO m => Text -> Text -> IpfsT m LogLevelObj
level subsystem = call . _logLevel subsystem . Just
tail :: MonadIO m => m ()
tail = streamCall _logTail
ls :: MonadIO m => IpfsT m LogLsObj
ls = call _logLs