Skip to content
This repository was archived by the owner on Mar 1, 2019. It is now read-only.

Commit 2c35ad3

Browse files
authored
Merge pull request input-output-hk/cardano-sl#3533 from input-output-hk/adiemand/CBR-275/mimic-logging-interface
[CBR-275] stack logging ontop of 'katip', provides structured logging
2 parents 9933762 + d712da3 commit 2c35ad3

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

Diff for: cardano-sl-wallet-new.cabal

+1
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ executable wal-integr-test
368368
, cardano-sl
369369
, cardano-sl-core
370370
, cardano-sl-chain
371+
, cardano-sl-util
371372
, cardano-sl-wallet
372373
, cardano-sl-wallet-new
373374
, containers

Diff for: integration/TransactionSpecs.hs

+3-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import Util
1818
import qualified Data.Map.Strict as Map
1919
import qualified Pos.Chain.Txp as Txp
2020
import qualified Pos.Core as Core
21+
import Pos.Util.Log.LoggerConfig (defaultTestConfiguration)
22+
import Pos.Util.Wlog (Severity (Debug), setupLogging)
2123

2224

2325
{-# ANN module ("HLint: ignore Reduce duplication" :: Text) #-}
@@ -29,8 +31,7 @@ ppShowT :: Show a => a -> Text
2931
ppShowT = fromString . ppShow
3032

3133
transactionSpecs :: WalletRef -> WalletClient IO -> Spec
32-
transactionSpecs wRef wc =
33-
34+
transactionSpecs wRef wc = beforeAll_ (setupLogging (defaultTestConfiguration Debug)) $
3435
describe "Transactions" $ do
3536

3637
randomTest "posted transactions appear in the index" 1 $ do

Diff for: src/Cardano/Wallet/Kernel/Keystore.hs

+2-3
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ import Pos.Crypto (EncryptedSecretKey, hash)
4141
import Pos.Util.UserSecret (UserSecret, getUSPath, isEmptyUserSecret,
4242
readUserSecret, takeUserSecret, usKeys, usWallet,
4343
writeRaw, writeUserSecretRelease, _wusRootKey)
44-
import Pos.Util.Wlog (CanLog (..), HasLoggerName (..),
45-
LoggerName (..), logMessage)
44+
import Pos.Util.Wlog (CanLog (..), HasLoggerName (..), logMessage)
4645

4746
import Cardano.Wallet.Kernel.DB.HdWallet (eskToHdRootId)
4847
import Cardano.Wallet.Kernel.Types (WalletId (..))
@@ -59,7 +58,7 @@ newtype KeystoreM a = KeystoreM { fromKeystore :: IO a }
5958
deriving (Functor, Applicative, Monad, MonadIO)
6059

6160
instance HasLoggerName KeystoreM where
62-
askLoggerName = return (LoggerName "Keystore")
61+
askLoggerName = return "Keystore"
6362
modifyLoggerName _ action = action
6463

6564
instance CanLog KeystoreM where

Diff for: test/InternalAPISpec.hs

+4-2
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ import Pos.Client.KeyStorage (getSecretKeysPlain)
2020
import Pos.Wallet.Web.Account (genSaveRootKey)
2121

2222
import Pos.Launcher (HasConfigurations)
23+
import Pos.Util.Log.LoggerConfig (defaultTestConfiguration)
24+
import Pos.Util.Wlog (Severity (Debug), setupLogging)
2325
import Test.Pos.Util.QuickCheck.Property (assertProperty)
2426

25-
import Test.Hspec (Spec, describe)
27+
import Test.Hspec (Spec, beforeAll_, describe)
2628
import Test.Hspec.QuickCheck (modifyMaxSuccess)
2729
import Test.Pos.Configuration (withDefConfigurations)
2830
import Test.Pos.Wallet.Web.Mode (walletPropertySpec)
@@ -35,7 +37,7 @@ import Servant
3537
{-# ANN module ("HLint: ignore Reduce duplication" :: Text) #-}
3638

3739
spec :: Spec
38-
spec =
40+
spec = beforeAll_ (setupLogging (defaultTestConfiguration Debug)) $
3941
withDefConfigurations $ \_ _ _ ->
4042
describe "development endpoint" $
4143
describe "secret-keys" $ modifyMaxSuccess (const 10) deleteAllSecretKeysSpec

0 commit comments

Comments
 (0)