mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2025-06-28 12:19:54 +00:00
Merge branch 'av/core-loglevel' into av/core-loglevel-android
This commit is contained in:
commit
3655ab85e6
1 changed files with 5 additions and 2 deletions
|
@ -54,7 +54,7 @@ import Simplex.Messaging.Encoding.String
|
|||
import Simplex.Messaging.Parsers (defaultJSON, dropPrefix, sumTypeJSON)
|
||||
import Simplex.Messaging.Protocol (AProtoServerWithAuth (..), AProtocolType (..), BasicAuth (..), CorrId (..), ProtoServerWithAuth (..), ProtocolServer (..))
|
||||
import Simplex.Messaging.Util (catchAll, liftEitherWith, safeDecodeUtf8)
|
||||
import System.IO (utf8)
|
||||
import System.IO (BufferMode (..), hSetBuffering, stderr, stdout, utf8)
|
||||
import System.Timeout (timeout)
|
||||
|
||||
data DBMigrationResult
|
||||
|
@ -267,7 +267,10 @@ handleErr :: IO () -> IO String
|
|||
handleErr a = (a $> "") `catch` (pure . show @SomeException)
|
||||
|
||||
chatSendCmd :: ChatController -> B.ByteString -> IO JSONByteString
|
||||
chatSendCmd cc = withGlobalLogging logCfg . chatSendRemoteCmd cc Nothing
|
||||
chatSendCmd cc cmd = withGlobalLogging logCfg $ do
|
||||
hSetBuffering stdout LineBuffering
|
||||
hSetBuffering stderr LineBuffering
|
||||
chatSendRemoteCmd cc Nothing cmd
|
||||
|
||||
chatSendRemoteCmd :: ChatController -> Maybe RemoteHostId -> B.ByteString -> IO JSONByteString
|
||||
chatSendRemoteCmd cc rh s = J.encode . APIResponse Nothing rh <$> runReaderT (execChatCommand rh s) cc
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue