diff --git a/hnix-store-remote/hnix-store-remote.cabal b/hnix-store-remote/hnix-store-remote.cabal index cf37240..fd68d8c 100644 --- a/hnix-store-remote/hnix-store-remote.cabal +++ b/hnix-store-remote/hnix-store-remote.cabal @@ -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: diff --git a/hnix-store-remote/src/System/Nix/Store/Remote/Serialize.hs b/hnix-store-remote/src/System/Nix/Store/Remote/Serialize.hs index 70e7f55..bfc632e 100644 --- a/hnix-store-remote/src/System/Nix/Store/Remote/Serialize.hs +++ b/hnix-store-remote/src/System/Nix/Store/Remote/Serialize.hs @@ -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 diff --git a/hnix-store-remote/src/System/Nix/Store/Remote/Types.hs b/hnix-store-remote/src/System/Nix/Store/Remote/Types.hs index 5c2e1de..818ca7b 100644 --- a/hnix-store-remote/src/System/Nix/Store/Remote/Types.hs +++ b/hnix-store-remote/src/System/Nix/Store/Remote/Types.hs @@ -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 diff --git a/hnix-store-remote/src/System/Nix/Store/Remote/Types/Verbosity.hs b/hnix-store-remote/src/System/Nix/Store/Remote/Types/Verbosity.hs new file mode 100644 index 0000000..b9ff9ea --- /dev/null +++ b/hnix-store-remote/src/System/Nix/Store/Remote/Types/Verbosity.hs @@ -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)