-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #305 from tloncorp/develop
Promote to staging
- Loading branch information
Showing
7 changed files
with
178 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/- *logs | ||
=< | ||
|_ [our=ship =wire] | ||
:: | ||
++ fail | ||
|= [desc=term trace=tang =log-data] | ||
^- card:agent:gall | ||
=/ event=$>(%fail log-event) | ||
[%fail desc trace] | ||
(pass event log-data) | ||
:: | ||
++ tell | ||
|= [vol=volume =echo =log-data] | ||
^- card:agent:gall | ||
=/ event=$>(%tell log-event) | ||
[%tell vol echo] | ||
(pass event log-data) | ||
:: | ||
++ pass | ||
|= [event=log-event data=log-data] | ||
^- card:agent:gall | ||
[%pass wire %agent [our %logs] %poke log-action+!>([%log event data])] | ||
-- | ||
|% | ||
:: | ||
++ fail-event | ||
|= [=term =tang] | ||
^- $>(%fail log-event) | ||
[%fail term tang] | ||
:: | ||
++ tell-event | ||
|= [vol=volume =echo] | ||
^- $>(%tell log-event) | ||
[%tell vol echo] | ||
:: | ||
++ enjs | ||
=, format | ||
|% | ||
++ tang | ||
|= t=^tang | ||
^- $>(%a json) | ||
?~ t a+~ | ||
=/ tame=(list tape) | ||
%- zing | ||
%+ turn t | ||
(cury wash [0 80]) | ||
a+(turn tame tape:enjs) | ||
:: | ||
++ log-event | ||
|= e=^log-event | ||
^- $>(%o json) | ||
=* event-type -.e | ||
?- -.e | ||
%fail | ||
=- ?>(?=(%o -.-) -) | ||
%- pairs:enjs | ||
:~ type/s+event-type | ||
description/s+desc.e | ||
stacktrace/(tang trace.e) | ||
== | ||
:: | ||
%tell | ||
=- ?>(?=(%o -.-) -) | ||
%- pairs:enjs | ||
:~ type/s+event-type | ||
message/(tang echo.e) | ||
volume/s+vol.e | ||
== | ||
== | ||
-- | ||
-- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/+ mp=mop-extensions | ||
:: | ||
|% | ||
:: $echo: formatted message | ||
+$ echo (list tank) | ||
:: $volume: echo volume | ||
+$ volume ?(%info %warn %crit) | ||
:: $log-event | ||
:: | ||
:: %fail: agent failure | ||
:: %tell: agent message | ||
:: | ||
+$ log-event | ||
$% [%fail desc=term trace=tang] | ||
[%tell vol=volume =echo] | ||
== | ||
:: $log-item: event with timestamp | ||
+$ log-item [=time event=log-event] | ||
:: $log-data: supplemental data | ||
+$ log-data (list (pair @t json)) | ||
:: | ||
+$ a-log | ||
$% [%log log-event data=log-data] | ||
== | ||
-- |