summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJappie <>2018-06-13 03:43:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2018-06-13 03:43:00 (GMT)
commit07d6502689c4daee43ac374d89d128b9586cedf9 (patch)
tree8388ed6155741cc354a5f2a05ce706eab4ece4d3
parent5b608d4f2f792b403296f48ba3e7e014e45f4b5a (diff)
version 0.7.0.00.7.0.0
-rw-r--r--app/Main.hs5
-rw-r--r--speechmatics.cabal13
-rw-r--r--src/Speechmatics/Client.hs11
3 files changed, 18 insertions, 11 deletions
diff --git a/app/Main.hs b/app/Main.hs
index 9e67b43..39f5309 100644
--- a/app/Main.hs
+++ b/app/Main.hs
@@ -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 @@ main = runCommand $ \opts args -> do
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
diff --git a/speechmatics.cabal b/speechmatics.cabal
index 24a7eb0..327ce1d 100644
--- a/speechmatics.cabal
+++ b/speechmatics.cabal
@@ -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 @@ library
, 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 @@ executable speechmatics
, 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 @@ test-suite speechmatics-test
build-depends:
base >=4.7 && <5
, bytestring
+ , heavy-logger
, hspec
- , monad-logger
, mtl
, neat-interpolation
, speechmatics
, text
+ , text-format-heavy
other-modules:
PeekJobSpec
PostJobSpec
diff --git a/src/Speechmatics/Client.hs b/src/Speechmatics/Client.hs
index cffe42e..3dc9b76 100644
--- a/src/Speechmatics/Client.hs
+++ b/src/Speechmatics/Client.hs
@@ -32,23 +32,24 @@ import Network.HTTP.Client.OpenSSL
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