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

Commit

Permalink
Merge pull request input-output-hk/cardano-sl#3533 from input-output-…
Browse files Browse the repository at this point in the history
…hk/adiemand/CBR-275/mimic-logging-interface

[CBR-275] stack logging ontop of 'katip', provides structured logging
  • Loading branch information
CodiePP authored Sep 15, 2018
2 parents 9933762 + d712da3 commit 2c35ad3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions cardano-sl-wallet-new.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ executable wal-integr-test
, cardano-sl
, cardano-sl-core
, cardano-sl-chain
, cardano-sl-util
, cardano-sl-wallet
, cardano-sl-wallet-new
, containers
Expand Down
5 changes: 3 additions & 2 deletions integration/TransactionSpecs.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import Util
import qualified Data.Map.Strict as Map
import qualified Pos.Chain.Txp as Txp
import qualified Pos.Core as Core
import Pos.Util.Log.LoggerConfig (defaultTestConfiguration)
import Pos.Util.Wlog (Severity (Debug), setupLogging)


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

transactionSpecs :: WalletRef -> WalletClient IO -> Spec
transactionSpecs wRef wc =

transactionSpecs wRef wc = beforeAll_ (setupLogging (defaultTestConfiguration Debug)) $
describe "Transactions" $ do

randomTest "posted transactions appear in the index" 1 $ do
Expand Down
5 changes: 2 additions & 3 deletions src/Cardano/Wallet/Kernel/Keystore.hs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ import Pos.Crypto (EncryptedSecretKey, hash)
import Pos.Util.UserSecret (UserSecret, getUSPath, isEmptyUserSecret,
readUserSecret, takeUserSecret, usKeys, usWallet,
writeRaw, writeUserSecretRelease, _wusRootKey)
import Pos.Util.Wlog (CanLog (..), HasLoggerName (..),
LoggerName (..), logMessage)
import Pos.Util.Wlog (CanLog (..), HasLoggerName (..), logMessage)

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

instance HasLoggerName KeystoreM where
askLoggerName = return (LoggerName "Keystore")
askLoggerName = return "Keystore"
modifyLoggerName _ action = action

instance CanLog KeystoreM where
Expand Down
6 changes: 4 additions & 2 deletions test/InternalAPISpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ import Pos.Client.KeyStorage (getSecretKeysPlain)
import Pos.Wallet.Web.Account (genSaveRootKey)

import Pos.Launcher (HasConfigurations)
import Pos.Util.Log.LoggerConfig (defaultTestConfiguration)
import Pos.Util.Wlog (Severity (Debug), setupLogging)
import Test.Pos.Util.QuickCheck.Property (assertProperty)

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

spec :: Spec
spec =
spec = beforeAll_ (setupLogging (defaultTestConfiguration Debug)) $
withDefConfigurations $ \_ _ _ ->
describe "development endpoint" $
describe "secret-keys" $ modifyMaxSuccess (const 10) deleteAllSecretKeysSpec
Expand Down

0 comments on commit 2c35ad3

Please sign in to comment.