From 8baaeb414fe874086d1b92cc89ec5502ad8fdfdc Mon Sep 17 00:00:00 2001
From: Tyler Goodlet <jgbt@protonmail.com>
Date: Mon, 15 Apr 2024 15:20:00 -0400
Subject: [PATCH] Tweak a couple more log message fmts

---
 tractor/_context.py   |  2 +-
 tractor/_streaming.py | 15 +++++++++------
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/tractor/_context.py b/tractor/_context.py
index 29fee0b1..052c198d 100644
--- a/tractor/_context.py
+++ b/tractor/_context.py
@@ -1905,7 +1905,7 @@ class Context:
 
         try:
             log.runtime(
-                f'Delivering msg from IPC ctx:\n'
+                f'Delivering msg from IPC ctx:\n\n'
                 f'<= {from_uid}\n'
                 f'  |_ {nsf}()\n\n'
 
diff --git a/tractor/_streaming.py b/tractor/_streaming.py
index ac4d482e..16e32cea 100644
--- a/tractor/_streaming.py
+++ b/tractor/_streaming.py
@@ -377,14 +377,17 @@ class MsgStream(trio.abc.Channel):
         #         await rx_chan.aclose()
 
         if not self._eoc:
-            log.cancel(
-                'Stream closed by self before it received an EoC?\n'
-                'Setting eoc manually..\n..'
-            )
-            self._eoc: bool = trio.EndOfChannel(
-                f'Context stream closed by self({self._ctx.side})\n'
+            message: str = (
+                f'Context stream closed by {self._ctx.side!r}\n'
                 f'|_{self}\n'
             )
+            log.cancel(
+                'Stream self-closed before receiving EoC\n\n'
+                +
+                message
+            )
+            self._eoc = trio.EndOfChannel(message)
+
         # ?XXX WAIT, why do we not close the local mem chan `._rx_chan` XXX?
         # => NO, DEFINITELY NOT! <=
         # if we're a bi-dir ``MsgStream`` BECAUSE this same