Skip to content

Commit

Permalink
Introduce MsgRemovingPool constructor of PoolDbLog.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanknowles committed Aug 20, 2020
1 parent 5d016da commit 0dd946f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/core/src/Cardano/Pool/DB/Sqlite.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ module Cardano.Pool.DB.Sqlite

import Prelude

import Cardano.BM.Data.Severity
( Severity (..) )
import Cardano.BM.Data.Tracer
( HasPrivacyAnnotation (..), HasSeverityAnnotation (..) )
import Cardano.DB.Sqlite
Expand Down Expand Up @@ -678,16 +680,23 @@ fromPoolMeta meta = (poolMetadataHash meta,) $
Logging
-------------------------------------------------------------------------------}

newtype PoolDbLog
data PoolDbLog
= MsgGeneric DBLog
| MsgRemovingPool PoolId
deriving (Eq, Show)

instance HasPrivacyAnnotation PoolDbLog

instance HasSeverityAnnotation PoolDbLog where
getSeverityAnnotation = \case
MsgGeneric e -> getSeverityAnnotation e
MsgRemovingPool {} -> Notice

instance ToText PoolDbLog where
toText = \case
MsgGeneric e -> toText e
MsgRemovingPool p -> mconcat
[ "Removing the following pool from the database: "
, toText p
, "."
]

0 comments on commit 0dd946f

Please sign in to comment.