@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.
@@ -385,7 +385,7 @@ var gobjJs = (function(exports) {
385
385
  function tab() {
386
386
  return " ".repeat(Math.max(1, __inside__ * 2));
387
387
  }
388
- var __trace_machine_format__ = 0;
388
+ var __trace_machine_format__ = 1;
389
389
  function gobj_set_trace_machine_format(format) {
390
390
  __trace_machine_format__ = Number(format) === 1 ? 1 : 0;
391
391
  }
@@ -2298,7 +2298,9 @@ var gobjJs = (function(exports) {
2298
2298
  gobj.current_state = new_state;
2299
2299
  let tracea = is_machine_tracing(gobj, "EV_STATE_CHANGED");
2300
2300
  let tracea_states = __trace_gobj_states__(gobj) ? true : false;
2301
- 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));
2301
+ if (tracea || tracea_states) {
2302
+ 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));
2303
+ }
2302
2304
  return true;
2303
2305
  }
2304
2306
  /***************************************************************************
@@ -2491,7 +2493,8 @@ var gobjJs = (function(exports) {
2491
2493
  if (dst.gclass.gmt.mt_inject_event) {
2492
2494
  __inside__--;
2493
2495
  if (tracea) {
2494
- 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)));
2496
+ if (__trace_machine_format__ === 1) trace_machine(sprintf("🔜 %s %s%s %s", event ? event : "", !dst.running ? "!!" : "", gobj_short_name(dst), state.state_name));
2497
+ 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)));
2495
2498
  if (kw) {
2496
2499
  if (tracea > 1) {
2497
2500
  if (json_object_size(kw)) trace_json(kw);
@@ -2872,8 +2875,9 @@ var gobjJs = (function(exports) {
2872
2875
  }
2873
2876
  let tracea = __yuno__ && gobj_read_bool_attr(__yuno__, "trace_subscriptions");
2874
2877
  if (tracea) {
2875
- 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 : "", ""));
2876
- trace_json(kw);
2878
+ 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));
2879
+ 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 : "", ""));
2880
+ if (json_object_size(kw)) trace_json(kw);
2877
2881
  }
2878
2882
  if (publisher.gclass.gmt.mt_publish_event) {
2879
2883
  let topublish = publisher.gclass.gmt.mt_publish_event(publisher, event, kw);
@@ -2920,8 +2924,9 @@ var gobjJs = (function(exports) {
2920
2924
  if (__config__) {}
2921
2925
  if (__global__) json_object_update(kw2publish, __global__);
2922
2926
  if (tracea) {
2923
- 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)));
2924
- trace_json(kw2publish);
2927
+ if (__trace_machine_format__ === 1) trace_machine(sprintf("🔝🔄 %s (%s) %s%s", event ? event : "", event ? event : "", !subscriber.running ? "!!" : "", gobj_short_name(subscriber)));
2928
+ 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)));
2929
+ if (json_object_size(kw2publish)) trace_json(kw2publish);
2925
2930
  }
2926
2931
  let ret_ = gobj_send_event(subscriber, event, kw2publish, publisher);
2927
2932
  if (ret_ < 0 && subs_flag & subs_flag_t.__own_event__) {