Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Commit

Permalink
Merge pull request #3534 from input-output-hk/adiemand/CBR-275/cleanu…
Browse files Browse the repository at this point in the history
…p-interface-for-structured-logging

[CBR-275] cleanup interface required for structured logging

WithLogger m = CanLog m, HasLoggerName m
  • Loading branch information
CodiePP authored Sep 2, 2018
2 parents 3e76205 + 5326cea commit aab9f13
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
5 changes: 2 additions & 3 deletions auxx/src/Command/Update.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ import Pos.Crypto (Hash, ProtocolMagic, emptyPassphrase, hash,
hashHexF, unsafeHash, withSafeSigner, withSafeSigners)
import Pos.Infra.Diffusion.Types (Diffusion (..))
import Pos.Network.Update.Download (installerHash)
import Pos.Util.Wlog (CanLog, HasLoggerName, logDebug, logError,
logInfo)
import Pos.Util.Wlog (WithLogger, logDebug, logError, logInfo)

import Lang.Value (ProposeUpdateParams (..), ProposeUpdateSystem (..))
import Mode (MonadAuxxMode)
Expand Down Expand Up @@ -105,7 +104,7 @@ updateDataElement ProposeUpdateSystem{..} = do
dummyHash :: Hash Raw
dummyHash = unsafeHash (0 :: Integer)

hashFile :: (CanLog m, HasLoggerName m, MonadIO m) => Maybe FilePath -> m (Hash Raw)
hashFile :: (WithLogger m, MonadIO m) => Maybe FilePath -> m (Hash Raw)
hashFile Nothing = pure dummyHash
hashFile (Just filename) = do
fileData <- liftIO $ BSL.readFile filename
Expand Down
9 changes: 4 additions & 5 deletions wallet/src/Pos/Wallet/Web/Tracking/Sync.hs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ import Pos.Infra.Util.LogSafe (buildSafe, logDebugSP, logErrorSP,
import qualified Pos.Util.Modifier as MM
import Pos.Util.Servant (encodeCType)
import Pos.Util.Util (HasLens (..), getKeys, timed)
import Pos.Util.Wlog (CanLog, HasLoggerName, WithLogger, logDebug,
logError, logInfo, logWarning, modifyLoggerName)
import Pos.Util.Wlog (HasLoggerName, WithLogger, logDebug, logError,
logInfo, logWarning, modifyLoggerName)

import Pos.Wallet.Web.ClientTypes (CId, CTxMeta (..), Wal)
import Pos.Wallet.Web.Error.Types (WalletError (..))
Expand Down Expand Up @@ -734,8 +734,7 @@ calculateEstimatedRemainingTime (WS.SyncThroughput blocks) remainingBlocks =

-- | Apply the given 'CAccModifier' to a wallet.
applyModifierToWallet
:: ( CanLog m
, HasLoggerName m
:: ( WithLogger m
, MonadIO m
)
=> WalletDB
Expand Down Expand Up @@ -773,7 +772,7 @@ applyModifierToWallet db trackingOperation wid newBlockHeaderTip CAccModifier{..
newSyncState

rollbackModifierFromWallet
:: (CanLog m, HasLoggerName m, MonadSlots ctx m)
:: (WithLogger m, MonadSlots ctx m)
=> ProtocolConstants
-> WalletDB
-> TrackingOperation
Expand Down

0 comments on commit aab9f13

Please sign in to comment.