mirror of
https://github.com/urbit/shrub.git
synced 2024-12-25 13:04:17 +03:00
dbug: cleaner subscription printing
Previously, the pretty-printing for %incoming and %outgoing results was hanging on to and displaying irrelevant type information: "_list_ of subscriptions", "wire with _head and tail_", and so on. Here, we move to producing tangs, instead of vases, and print those. For the %incoming and %outgoing cases, we print a line for every subscription, sorting them by path and wire respectively, and giving clean, easily readable output.
This commit is contained in:
parent
fed93b1fe5
commit
50f7dc85fa
@ -32,44 +32,51 @@
|
||||
[cards this]
|
||||
=/ dbug
|
||||
!<(poke vase)
|
||||
=; out=^vase
|
||||
((slog (sell out) ~) [~ this])
|
||||
=; =tang
|
||||
((slog tang) [~ this])
|
||||
?- -.dbug
|
||||
%bowl !>(bowl)
|
||||
%bowl [(sell !>(bowl))]~
|
||||
::
|
||||
%state
|
||||
=? grab.dbug =('' grab.dbug) '-'
|
||||
=- [(sell !>(-))]~
|
||||
%+ slap
|
||||
(slop on-save:ag !>([bowl=bowl ..zuse]))
|
||||
(ream grab.dbug)
|
||||
::
|
||||
%incoming
|
||||
!>
|
||||
%+ murn ~(tap by sup.bowl)
|
||||
|= sub=[=duct [=ship =path]]
|
||||
^- (unit _sub)
|
||||
%+ murn
|
||||
%+ sort ~(tap by sup.bowl)
|
||||
|= [[* a=[=ship =path]] [* b=[=ship =path]]]
|
||||
(aor [path ship]:a [path ship]:b)
|
||||
|= [=duct [=ship =path]]
|
||||
^- (unit tank)
|
||||
=; relevant=?
|
||||
?:(relevant `sub ~)
|
||||
?. relevant ~
|
||||
`>[path=path from=ship duct=duct]<
|
||||
?- -.about.dbug
|
||||
%ship =(ship.sub ship.about.dbug)
|
||||
%path ?=(^ (find path.about.dbug path.sub))
|
||||
%wire %+ lien duct.sub
|
||||
%ship =(ship ship.about.dbug)
|
||||
%path ?=(^ (find path.about.dbug path))
|
||||
%wire %+ lien duct
|
||||
|=(=wire ?=(^ (find wire.about.dbug wire)))
|
||||
%term !!
|
||||
==
|
||||
::
|
||||
%outgoing
|
||||
!>
|
||||
%+ murn ~(tap by wex.bowl)
|
||||
|= sub=[[=wire =ship =term] [acked=? =path]]
|
||||
^- (unit _sub)
|
||||
%+ murn
|
||||
%+ sort ~(tap by wex.bowl)
|
||||
|= [[[a=wire *] *] [[b=wire *] *]]
|
||||
(aor a b)
|
||||
|= [[=wire =ship =term] [acked=? =path]]
|
||||
^- (unit tank)
|
||||
=; relevant=?
|
||||
?:(relevant `sub ~)
|
||||
?. relevant ~
|
||||
`>[wire=wire agnt=[ship term] path=path ackd=acked]<
|
||||
?- -.about.dbug
|
||||
%ship =(ship.sub ship.about.dbug)
|
||||
%path ?=(^ (find path.about.dbug path.sub))
|
||||
%wire ?=(^ (find wire.about.dbug wire.sub))
|
||||
%term =(term.sub term.about.dbug)
|
||||
%ship =(ship ship.about.dbug)
|
||||
%path ?=(^ (find path.about.dbug path))
|
||||
%wire ?=(^ (find wire.about.dbug wire))
|
||||
%term =(term term.about.dbug)
|
||||
==
|
||||
==
|
||||
::
|
||||
|
Loading…
Reference in New Issue
Block a user