{-# 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 :: Text -> Text -> IpfsT m LogLevelObj
level Text
subsystem = ClientM LogLevelObj -> IpfsT m LogLevelObj
forall (m :: * -> *) a. MonadIO m => ClientM a -> IpfsT m a
call (ClientM LogLevelObj -> IpfsT m LogLevelObj)
-> (Text -> ClientM LogLevelObj) -> Text -> IpfsT m LogLevelObj
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Maybe Text -> ClientM LogLevelObj
_logLevel Text
subsystem (Maybe Text -> ClientM LogLevelObj)
-> (Text -> Maybe Text) -> Text -> ClientM LogLevelObj
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Maybe Text
forall a. a -> Maybe a
Just
tail :: MonadIO m => m ()
tail :: m ()
tail = ClientM (SourceT IO Text) -> m ()
forall (m :: * -> *) a.
(MonadIO m, Show a) =>
ClientM (SourceT IO a) -> m ()
streamCall ClientM (SourceT IO Text)
_logTail
ls :: MonadIO m => IpfsT m LogLsObj
ls :: IpfsT m LogLsObj
ls = ClientM LogLsObj -> IpfsT m LogLsObj
forall (m :: * -> *) a. MonadIO m => ClientM a -> IpfsT m a
call ClientM LogLsObj
_logLs