SMP server CLI commands (#144)

SMP server CLI commands
This commit is contained in:
Evgeny Poberezkin
2021-05-23 11:10:00 +01:00
committed by GitHub
parent 5b39f51203
commit 5962c1bb3e
2 changed files with 185 additions and 86 deletions
+6
View File
@@ -10,6 +10,7 @@ module Simplex.Messaging.Server.StoreLog
( StoreLog, -- constructors are not exported
openWriteStoreLog,
openReadStoreLog,
storeLogFilePath,
closeStoreLog,
logCreateQueue,
logSecureQueue,
@@ -88,6 +89,11 @@ openReadStoreLog f = do
doesFileExist f >>= (`unless` writeFile f "")
ReadStoreLog f <$> openFile f ReadMode
storeLogFilePath :: StoreLog a -> FilePath
storeLogFilePath = \case
WriteStoreLog f _ -> f
ReadStoreLog f _ -> f
closeStoreLog :: StoreLog a -> IO ()
closeStoreLog = \case
WriteStoreLog _ h -> hClose h