Change some log messages.

This commit is contained in:
Philippe Pittoli 2023-07-05 03:18:01 +02:00
parent 5ed167d8bb
commit 634b30bbf5
3 changed files with 7 additions and 11 deletions

View File

@ -234,7 +234,7 @@ handleQuery = case _ of
pure (Just a) pure (Just a)
-- The authentication was a success! -- The authentication was a success!
(AuthD.GotToken msg) -> do (AuthD.GotToken msg) -> do
H.raise $ AppendMessage $ "[🎉] Authenticated!" H.raise $ AppendMessage $ "[🎉] Authenticated to authd!"
H.raise $ AuthToken (Tuple msg.uid msg.token) H.raise $ AuthToken (Tuple msg.uid msg.token)
pure (Just a) pure (Just a)
-- WTH?! -- WTH?!

View File

@ -258,7 +258,7 @@ handleQuery = case _ of
handleAction $ UpdateAcceptedDomains response.domains handleAction $ UpdateAcceptedDomains response.domains
(DNSManager.MkLogged response) -> do (DNSManager.MkLogged response) -> do
H.raise $ AppendMessage $ "[😈] Authenticated!" H.raise $ AppendMessage $ "[🎉] Authenticated to dnsmanagerd!"
handleAction $ UpdateAcceptedDomains response.accepted_domains handleAction $ UpdateAcceptedDomains response.accepted_domains
handleAction $ UpdateMyDomains response.my_domains handleAction $ UpdateMyDomains response.my_domains

View File

@ -112,7 +112,7 @@ handleAction action = do
handleAction ConnectWebSocket handleAction ConnectWebSocket
Finalize -> do Finalize -> do
H.raise $ AppendSystemMessage $ "Closing websocket for '" <> wsInfo.url <> "'" -- H.raise $ AppendSystemMessage $ "Closing websocket for '" <> wsInfo.url <> "'"
case wsInfo.connection of case wsInfo.connection of
Nothing -> H.raise $ AppendSystemMessage "No socket? How is that even possible?" Nothing -> H.raise $ AppendSystemMessage "No socket? How is that even possible?"
Just socket -> H.liftEffect $ WS.close socket Just socket -> H.liftEffect $ WS.close socket
@ -121,7 +121,7 @@ handleAction action = do
H.raise $ AppendSystemMessage $ renderError (UnknownError error) H.raise $ AppendSystemMessage $ renderError (UnknownError error)
ConnectWebSocket -> do ConnectWebSocket -> do
H.raise $ AppendSystemMessage ("Connecting to \"" <> wsInfo.url <> "\"...") -- H.raise $ AppendSystemMessage $ "Connecting to \"" <> wsInfo.url <> "\"..."
webSocket <- H.liftEffect $ WS.create wsInfo.url [] webSocket <- H.liftEffect $ WS.create wsInfo.url []
H.liftEffect $ WS.setBinaryType webSocket ArrayBuffer H.liftEffect $ WS.setBinaryType webSocket ArrayBuffer
H.modify_ _ { wsInfo { connection = Just webSocket } } H.modify_ _ { wsInfo { connection = Just webSocket } }
@ -136,11 +136,11 @@ handleAction action = do
HandleWebSocket wsEvent -> do HandleWebSocket wsEvent -> do
case wsEvent of case wsEvent of
WebSocketMessage received_message -> do WebSocketMessage received_message -> do
-- H.raise $ AppendMessage $ "[😈] Received a message"
H.raise $ MessageReceived $ Tuple wsInfo.url received_message.message H.raise $ MessageReceived $ Tuple wsInfo.url received_message.message
H.raise $ AppendMessage $ "[😈] Received a message"
WebSocketOpen -> do WebSocketOpen -> do
H.raise $ AppendSystemMessage ("Successfully connected to WebSocket at \"" <> wsInfo.url <> "\"!🎉") -- H.raise $ AppendSystemMessage ("Successfully connected to \"" <> wsInfo.url <> "\"!🎉")
H.raise $ WSJustConnected H.raise $ WSJustConnected
WebSocketClose { code, reason, wasClean } -> do WebSocketClose { code, reason, wasClean } -> do
@ -168,11 +168,7 @@ handleAction action = do
baseCloseMessage = baseCloseMessage =
String.joinWith " " String.joinWith " "
[ "Connection to WebSocket closed" [ "Connection to WebSocket closed"
, "[ CODE:" , "[ CODE:" , show code , "|" , if wasClean then "CLEAN" else "DIRTY" , "]"
, show code
, "|"
, if wasClean then "CLEAN" else "DIRTY"
, "]"
] ]
handleQuery :: forall a m. MonadAff m => Query a -> H.HalogenM State Action () Output m (Maybe a) handleQuery :: forall a m. MonadAff m => Query a -> H.HalogenM State Action () Output m (Maybe a)