vere: fix printing of cord tanks (re-distinguish from serf stderr

This commit is contained in:
Joe Bryan 2020-12-06 16:55:20 -08:00
parent b3c07c8d85
commit 28e62730d6
4 changed files with 31 additions and 19 deletions

View File

@ -44,7 +44,8 @@
+$ plea
$% [%live ~]
[%ripe [pro=%1 hon=@ nok=@] eve=@ mug=@]
[%slog pri=@ ?(cord tank)]
[%slog pri=@ tank]
[%flog cord]
$: %peek
$% [%done dat=(unit (cask))]
[%bail dud=goof]
@ -360,6 +361,24 @@ _lord_plea_slog(u3_lord* god_u, u3_noun dat)
u3z(dat);
}
/* _lord_plea_flog(): hear serf debug output
*/
static void
_lord_plea_flog(u3_lord* god_u, u3_noun dat)
{
u3_noun pri, tan;
c3_w pri_w;
if ( c3n == u3a_is_atom(dat) ) {
return _lord_plea_foul(god_u, c3__slog, dat);
}
c3_c* tan_c = u3r_string(tan);
u3C.stderr_log_f(tan_c);
c3_free(tan_c);
u3z(dat);
}
/* _lord_plea_peek_bail(): hear serf %peek %bail
*/
static void
@ -720,6 +739,10 @@ _lord_on_plea(void* ptr_v, c3_d len_d, c3_y* byt_y)
_lord_plea_slog(god_u, u3k(dat));
} break;
case c3__flog: {
_lord_plea_flog(god_u, u3k(dat));
} break;
case c3__play: {
_lord_plea_play(god_u, u3k(dat));
} break;

View File

@ -1256,23 +1256,11 @@ _pier_on_lord_slog(void* ptr_v, c3_w pri_w, u3_noun tan)
{
u3_pier* pir_u = ptr_v;
if ( c3y == u3a_is_atom(tan) ) {
c3_c* tan_c = u3r_string(tan);
u3C.stderr_log_f(tan_c);
c3_free(tan_c);
if ( 0 != pir_u->sog_f ) {
pir_u->sog_f(pir_u->sop_p, pri_w, u3k(tan));
}
}
else {
u3_pier_tank(0, pri_w, u3k(tan));
if ( 0 != pir_u->sog_f ) {
pir_u->sog_f(pir_u->sop_p, pri_w, u3k(tan));
}
if ( 0 != pir_u->sog_f ) {
pir_u->sog_f(pir_u->sop_p, pri_w, u3k(tan));
}
u3z(tan);
u3_pier_tank(0, pri_w, tan);
}
/* _pier_on_lord_save(): worker (non-portable) snapshot complete.

View File

@ -77,12 +77,12 @@ _cw_serf_send_slog(u3_noun hod)
_cw_serf_send(u3nc(c3__slog, hod));
}
/* _cw_serf_send_stdr(): send stderr output
/* _cw_serf_send_stdr(): send stderr output (%flog)
*/
static void
_cw_serf_send_stdr(c3_c* str_c)
{
_cw_serf_send_slog(u3nc(0, u3i_string(str_c)));
_cw_serf_send(u3nc(c3__flog, u3i_string(str_c)));
}

View File

@ -46,7 +46,8 @@
+$ plea
$% [%live ~]
[%ripe [pro=%1 hon=@ nok=@] eve=@ mug=@]
[%slog pri=@ ?(cord tank)]
[%slog pri=@ tank]
[%flog cord]
$: %peek
$% [%done dat=(unit (cask))]
[%bail dud=goof]