speechmatics 0.6.0.0 → 0.7.0.0
raw patch · 3 files changed
+18/−11 lines, 3 filesdep +heavy-loggerdep +text-format-heavydep −monad-loggerPVP ok
version bump matches the API change (PVP)
Dependencies added: heavy-logger, text-format-heavy
Dependencies removed: monad-logger
API changes (from Hackage documentation)
Files
- app/Main.hs +4/−1
- speechmatics.cabal +8/−5
- src/Speechmatics/Client.hs +6/−5
app/Main.hs view
@@ -2,15 +2,17 @@ module Main where -import Control.Monad.Logger(LoggingT(..), runStdoutLoggingT, logInfoNS, logDebugNS, logWarnNS, logErrorNS, MonadLogger) import Network.Mime(defaultMimeLookup) import Options import qualified Data.ByteString.Lazy as LBS import Data.Digest.Pure.SHA+import System.Log.Heavy import Speechmatics.Client import Network.Mime(MimeType) import Data.Text(pack, Text) import Data.Aeson (decode)+import System.Log.Heavy.Backends (defStdoutSettings)+import System.Log.Heavy.Types(LoggingSettings(..)) data MainOptions = MainOptions { @@ -35,6 +37,7 @@ Nothing -> print "wrong options, see --help" Just compute -> compute +runStdoutLoggingT = withLoggingT $ LoggingSettings defStdoutSettings withBearAndFile :: UserID -> AuthToken -> FilePath -> IO() withBearAndFile userId bearToken file = do -- result <- transcribeFile bearToken file
speechmatics.cabal view
@@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: cc509a2a8595bbf451ac07ba7f538d6fce13a779255b88f9e04880c1420bb01b+-- hash: 647d0f891a79463d3078719ace8c4e3709d4edaf328525db0ea3f6f294e05b58 name: speechmatics-version: 0.6.0.0+version: 0.7.0.0 synopsis: Speechmatics api client description: Upload audio files to speechmatics to get a transcription category: API@@ -30,15 +30,16 @@ , aeson , base >=4.7 && <5 , bytestring+ , heavy-logger , http-client , http-client-openssl , http-types , json-autotype , lens , mime-types- , monad-logger , mtl , text+ , text-format-heavy , wreq exposed-modules: Speechmatics.Client@@ -58,12 +59,13 @@ , aeson , base >=4.7 && <5 , bytestring+ , heavy-logger , mime-types- , monad-logger , mtl , options , speechmatics , text+ , text-format-heavy other-modules: Paths_speechmatics default-language: Haskell2010@@ -77,12 +79,13 @@ build-depends: base >=4.7 && <5 , bytestring+ , heavy-logger , hspec- , monad-logger , mtl , neat-interpolation , speechmatics , text+ , text-format-heavy other-modules: PeekJobSpec PostJobSpec
src/Speechmatics/Client.hs view
@@ -32,23 +32,24 @@ import Network.Mime (MimeType) import Network.Wreq -import Control.Monad.Logger (LoggingT (..), MonadLogger,- logDebugNS, logErrorNS, logInfoNS,- logWarnNS, runStdoutLoggingT)+import System.Log.Heavy.LoggingT(LoggingT(..))+import qualified System.Log.Heavy.Shortcuts as Logcut (info, debug)+import Data.Text.Format.Heavy.Instances (Single(..)) import qualified Data.ByteString.Char8 as C8BS import qualified Data.ByteString.Lazy as LBS import qualified Data.ByteString.Lazy.Char8 as C8LBS import Data.Maybe import Data.Monoid import Data.Text+import qualified Data.Text.Lazy as Lazy import qualified Network.Wreq.Session as Sess import qualified Speechmatics.JSON.PeekJob as Peek import qualified Speechmatics.JSON.PostJob as Post source :: Text source = "Speechmatics client"-info = logInfoNS source-debug = logDebugNS source+info d = Logcut.info (Lazy.fromStrict d) (Single source)+debug d = Logcut.debug (Lazy.fromStrict d) (Single source) -- warn = logWarnNS source -- error = logErrorNS source