remote: add Types.Verbosity

This commit is contained in:
Richard Marko 2023-11-23 15:58:19 +01:00 committed by sorki
parent 64a4368dfd
commit 96cbe1178d
4 changed files with 25 additions and 0 deletions

View File

@ -75,6 +75,7 @@ library
, System.Nix.Store.Remote.Types.ProtoVersion
, System.Nix.Store.Remote.Types.StoreConfig
, System.Nix.Store.Remote.Types.SubstituteMode
, System.Nix.Store.Remote.Types.Verbosity
, System.Nix.Store.Remote.Types.WorkerOp
build-depends:

View File

@ -20,6 +20,7 @@ import System.Nix.Derivation (Derivation(..), DerivationOutput(..))
import System.Nix.Build (BuildMode(..), BuildStatus(..), BuildResult(..))
import System.Nix.StorePath (StoreDir, StorePath)
import System.Nix.Store.Remote.Serialize.Prim
import System.Nix.Store.Remote.Types.Verbosity (Verbosity)
instance Serialize Text where
get = getText
@ -104,3 +105,7 @@ putDerivation storeDir Derivation{..} = do
flip putMany (Data.Map.toList env)
$ \(a1, a2) -> putText a1 *> putText a2
instance Serialize Verbosity where
get = getEnum
put = putEnum

View File

@ -4,6 +4,7 @@ module System.Nix.Store.Remote.Types
, module System.Nix.Store.Remote.Types.ProtoVersion
, module System.Nix.Store.Remote.Types.StoreConfig
, module System.Nix.Store.Remote.Types.SubstituteMode
, module System.Nix.Store.Remote.Types.Verbosity
, module System.Nix.Store.Remote.Types.WorkerOp
) where
@ -12,4 +13,5 @@ import System.Nix.Store.Remote.Types.Logger
import System.Nix.Store.Remote.Types.ProtoVersion
import System.Nix.Store.Remote.Types.StoreConfig
import System.Nix.Store.Remote.Types.SubstituteMode
import System.Nix.Store.Remote.Types.Verbosity
import System.Nix.Store.Remote.Types.WorkerOp

View File

@ -0,0 +1,17 @@
module System.Nix.Store.Remote.Types.Verbosity
( Verbosity(..)
) where
import GHC.Generics
-- | Logging verbosity
data Verbosity
= Verbosity_Error
| Verbosity_Warn
| Verbosity_Notice
| Verbosity_Info
| Verbosity_Talkative
| Verbosity_Chatty
| Verbosity_Debug
| Verbosity_Vomit
deriving (Bounded, Eq, Enum, Generic, Ord, Show)