@yuneta/gobj-js 7.13.6 → 7.13.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -387,7 +387,7 @@
387
387
  function tab() {
388
388
  return " ".repeat(Math.max(1, __inside__ * 2));
389
389
  }
390
- var __trace_machine_format__ = 0;
390
+ var __trace_machine_format__ = 1;
391
391
  function gobj_set_trace_machine_format(format) {
392
392
  __trace_machine_format__ = Number(format) === 1 ? 1 : 0;
393
393
  }
@@ -2300,7 +2300,9 @@
2300
2300
  gobj.current_state = new_state;
2301
2301
  let tracea = is_machine_tracing(gobj, "EV_STATE_CHANGED");
2302
2302
  let tracea_states = __trace_gobj_states__(gobj) ? true : false;
2303
- if (tracea || tracea_states) trace_machine(sprintf("🔀🔀 mach(%s%s^%s), new st(%s), prev st(%s)", !gobj.running ? "!!" : "", gobj_gclass_name(gobj), gobj_name(gobj), gobj_current_state(gobj), gobj.last_state.state_name));
2303
+ if (tracea || tracea_states) {
2304
+ if (__trace_machine_format__ === 1) {} else trace_machine(sprintf("🔀🔀 mach(%s%s^%s), new st(%s), prev st(%s)", !gobj.running ? "!!" : "", gobj_gclass_name(gobj), gobj_name(gobj), gobj_current_state(gobj), gobj.last_state.state_name));
2305
+ }
2304
2306
  return true;
2305
2307
  }
2306
2308
  /***************************************************************************
@@ -2493,7 +2495,8 @@
2493
2495
  if (dst.gclass.gmt.mt_inject_event) {
2494
2496
  __inside__--;
2495
2497
  if (tracea) {
2496
- trace_machine(sprintf("🔃 mach(%s%s), st: %s, ev: %s, from(%s%s)", !dst.running ? "!!" : "", gobj_short_name(dst), state.state_name, event ? event : "", src && !src.running ? "!!" : "", gobj_short_name(src)));
2498
+ if (__trace_machine_format__ === 1) trace_machine(sprintf("🔜 %s %s%s %s", event ? event : "", !dst.running ? "!!" : "", gobj_short_name(dst), state.state_name));
2499
+ else trace_machine(sprintf("🔃 mach(%s%s), st: %s, ev: %s, from(%s%s)", !dst.running ? "!!" : "", gobj_short_name(dst), state.state_name, event ? event : "", src && !src.running ? "!!" : "", gobj_short_name(src)));
2497
2500
  if (kw) {
2498
2501
  if (tracea > 1) {
2499
2502
  if (json_object_size(kw)) trace_json(kw);
@@ -2874,8 +2877,9 @@
2874
2877
  }
2875
2878
  let tracea = __yuno__ && gobj_read_bool_attr(__yuno__, "trace_subscriptions");
2876
2879
  if (tracea) {
2877
- trace_machine(sprintf("🔝🔝 mach(%s%s^%s), st: %s, ev: %s%s%s", !publisher.running ? "!!" : "", gobj_gclass_name(publisher), gobj_name(publisher), publisher.current_state.state_name, "", event ? event : "", ""));
2878
- trace_json(kw);
2880
+ if (__trace_machine_format__ === 1) trace_machine(sprintf("🔝🔝 %s %s%s %s", event ? event : "", !publisher.running ? "!!" : "", gobj_short_name(publisher), publisher.current_state.state_name));
2881
+ else trace_machine(sprintf("🔝🔝 mach(%s%s^%s), st: %s, ev: %s%s%s", !publisher.running ? "!!" : "", gobj_gclass_name(publisher), gobj_name(publisher), publisher.current_state.state_name, "", event ? event : "", ""));
2882
+ if (json_object_size(kw)) trace_json(kw);
2879
2883
  }
2880
2884
  if (publisher.gclass.gmt.mt_publish_event) {
2881
2885
  let topublish = publisher.gclass.gmt.mt_publish_event(publisher, event, kw);
@@ -2922,8 +2926,9 @@
2922
2926
  if (__config__) {}
2923
2927
  if (__global__) json_object_update(kw2publish, __global__);
2924
2928
  if (tracea) {
2925
- trace_machine(sprintf("🔝🔄 mach(%s%s), st: %s, ev: %s, from(%s%s)", !subscriber.running ? "!!" : "", gobj_short_name(subscriber), gobj_current_state(subscriber), event ? event : "", publisher && !publisher.running ? "!!" : "", gobj_short_name(publisher)));
2926
- trace_json(kw2publish);
2929
+ if (__trace_machine_format__ === 1) trace_machine(sprintf("🔝🔄 %s (%s) %s%s", event ? event : "", event ? event : "", !subscriber.running ? "!!" : "", gobj_short_name(subscriber)));
2930
+ else trace_machine(sprintf("🔝🔄 mach(%s%s), st: %s, ev: %s, from(%s%s)", !subscriber.running ? "!!" : "", gobj_short_name(subscriber), gobj_current_state(subscriber), event ? event : "", publisher && !publisher.running ? "!!" : "", gobj_short_name(publisher)));
2931
+ if (json_object_size(kw2publish)) trace_json(kw2publish);
2927
2932
  }
2928
2933
  let ret_ = gobj_send_event(subscriber, event, kw2publish, publisher);
2929
2934
  if (ret_ < 0 && subs_flag & subs_flag_t.__own_event__) {