diff --git a/CHANGES.md b/CHANGES.md index 6d07baef..0ec5a1ca 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,6 @@ ## 3.22.2 2021-01-14 -* Debug option to print full error stacks regardless of logger +* Debug option to print full error stacks regardless of logger. ## 3.22.1 2020-12-10 diff --git a/lib/logging.js b/lib/logging.js index 9282b20e..5b34d134 100644 --- a/lib/logging.js +++ b/lib/logging.js @@ -57,7 +57,7 @@ module.exports = make_logging function flat_logger(entry) { let opts = this.options() - + var level_str = (entry.level_name + '').toUpperCase() if (level_str.length < 5) { level_str += '_'.repeat(5 - level_str.length) @@ -122,7 +122,7 @@ function flat_logger(entry) { ] this.private$.print.log(sb.join('\t').substring(0, entry.maxlen$ || 11111)) - if(entry.err && opts.debug.print.err) { + if (entry.err && opts.debug.print.err) { this.private$.print.err(entry.err) } } diff --git a/seneca.js b/seneca.js index bb975ba5..c25df516 100644 --- a/seneca.js +++ b/seneca.js @@ -95,7 +95,7 @@ const option_defaults = { env: false, // Regardless of logging, call `console.err` on errors - err: false + err: false, }, // Trace action caller and place in args.caller$. diff --git a/test/coverage.html b/test/coverage.html index 722369c4..18f4c785 100644 --- a/test/coverage.html +++ b/test/coverage.html @@ -611,7 +611,7 @@

Test Report

0
0
354
-
36670
+
36974
@@ -728,70 +728,70 @@

Test Report

act make_actmsg - 53 + 58 2 act process_outward - 28 + 27 3 actions cmd_ping - 271 + 255 4 actions cmd_stats - 32 + 48 5 actions cmd_close - 139 + 145 6 actions info_fatal - 137 + 128 7 actions get_options - 42 + 50 8 add name - 33 + 34 9 add action_modifier - 154 + 165 10 api error - 6 + 7 11 @@ -805,42 +805,42 @@

Test Report

api translate - 137 + 140 13 api test-mode - 50 + 51 14 api find_plugin - 177 + 178 15 api has_plugin - 239 + 247 16 api ignore_plugin - 361 + 360 17 api has - 5 + 4 18 @@ -854,56 +854,56 @@

Test Report

api status - 139 + 140 20 api reply - 12 + 13 21 api delegate - 12 + 11 22 api fail invoked with a code and details - 3 + 1 23 api fail invoked with a condition, code and details when the condition is true throws - 2 + 1 24 api fail invoked with a condition, code and details when the condition is false does not throw - 0 + 1 25 api fail invoked with a condition, code and details when the condition is not a boolean throws informing the client of the wrong type - 2 + 1 26 api fail when given no arguments throws a seneca error - 1 + 0 27 @@ -917,91 +917,91 @@

Test Report

close happy - 123 + 131 29 close add - 126 + 128 30 close graceful - 237 + 236 31 close timeout - 127 + 124 32 close handle-signal - 125 + 126 33 close error - 124 + 129 34 close no-promise - 125 + 123 35 close with-promise - 126 + 125 36 close with-async-await - 123 + 126 37 common misc - 7 + 11 38 common deepextend-empty - 0 + 1 39 common deepextend-dups - 0 + 1 40 common deepextend-objs - 6 + 4 41 @@ -1015,14 +1015,14 @@

Test Report

common pattern - 0 + 1 43 common nil - 1 + 0 44 @@ -1043,14 +1043,14 @@

Test Report

common history - 5 + 6 47 common clean - 1 + 2 48 @@ -1071,7 +1071,7 @@

Test Report

custom custom-basic - 25 + 27 51 @@ -1092,105 +1092,105 @@

Test Report

custom custom-entity - 149 + 147 54 custom custom-prior - 19 + 20 55 custom custom-simple-transport - 153 + 156 56 custom custom-bells-transport - 277 + 278 57 custom custom-add-basic - 135 + 136 58 custom custom-add-fix - 22 + 20 59 debug logroute - 7 + 9 60 delegation happy - 143 + 148 61 delegation dynamic - 138 + 142 62 delegation prior.basic - 132 + 138 63 delegation parent.plugin - 150 + 158 64 entity happy - 78 + 74 65 entity entity-msg - 136 + 147 66 entity mem-ops - 187 + 245 67 error fail - 11 + 10 68 @@ -1204,98 +1204,98 @@

Test Report

error action_callback - 30 + 41 70 error plugin_load - 29 + 23 71 error act_not_found - 60 + 80 72 error exec_action_throw_basic - 19 + 27 73 error exec_action_throw_basic_legacy - 31 + 54 74 error exec_action_throw_nolog - 20 + 27 75 error exec_action_errhandler_throw - 59 + 101 76 error exec_action_result - 28 + 23 77 error exec_deep_action_result - 55 + 23 78 error exec_remote_action_result - 147 + 160 79 error exec_action_result_legacy - 29 + 33 80 error exec_action_result_nolog - 20 + 30 81 error exec_action_errhandler_result - 82 + 122 82 error action_callback - 174 + 183 83 @@ -1309,7 +1309,7 @@

Test Report

error types - 16 + 15 85 @@ -1323,42 +1323,42 @@

Test Report

explain explain-data - 57 + 46 87 explain explain-deep - 43 + 40 88 explain explain-toplevel - 131 + 136 89 explain explain-transport - 293 + 289 90 exports happy - 122 + 126 91 exports with-init - 121 + 123 92 @@ -1372,35 +1372,35 @@

Test Report

exports with-preload-and-init - 124 + 123 94 exports with-tags - 372 + 370 95 outward act_error - 1 + 0 96 inward announce - 122 + 121 97 inward arg-check - 2 + 3 98 @@ -1428,56 +1428,56 @@

Test Report

legacy no-default-transport - 118 + 120 102 legacy actdef - 12 + 15 103 logging happy - 127 + 126 104 logging happy-ng - 123 + 124 105 logging level-text-values - 11 + 10 106 logging build_log_spec - 10 + 8 107 logging event - 121 + 123 108 logging quiet - 124 + 123 109 @@ -1491,14 +1491,14 @@

Test Report

logging basic - 121 + 120 111 logging logger-output - 747 + 754 112 @@ -1512,28 +1512,28 @@

Test Report

logging test-mode-basic - 125 + 123 114 logging test-mode-option - 121 + 125 115 logging test-mode-argv - 121 + 126 116 logging test-mode-argv-opts - 125 + 124 117 @@ -1547,112 +1547,112 @@

Test Report

logging quiet-mode-basic - 123 + 124 119 logging quiet-mode-option - 124 + 121 120 logging quiet-mode-argv - 124 + 126 121 logging quiet-mode-argv-opts - 123 + 121 122 logging quiet-mode-env - 129 + 125 123 logging test-quiet-mode-basic - 122 + 123 124 logging quiet-test-mode-basic - 123 + 126 125 logging test-ready-quiet-mode-basic - 238 + 237 126 logging quiet-ready-test-mode-basic - 235 + 237 127 logging quiet-argv-override - 125 + 128 128 logging test-argv-override - 123 + 126 129 logging quiet-env-override - 124 + 125 130 logging test-env-override - 125 + 123 131 logging intern.build_act_entry - 1 + 2 132 message happy-parents - 23 + 22 133 message complex-parents - 23 + 20 134 @@ -1666,35 +1666,35 @@

Test Report

message branch - 25 + 33 136 message empty-response - 126 + 121 137 message reply - 123 + 122 138 message prior - 123 + 124 139 message entity - 42 + 53 140 @@ -1708,14 +1708,14 @@

Test Report

message simple-transport - 592 + 593 142 message partial-patterns - 125 + 126 143 @@ -1736,7 +1736,7 @@

Test Report

meta custom-fixed - 24 + 29 146 @@ -1750,21 +1750,21 @@

Test Report

options internal.routers - 17 + 22 148 order happy - 249 + 259 149 outward make_error - 2 + 0 150 @@ -1785,14 +1785,14 @@

Test Report

plugin use.intern - 12 + 11 153 plugin plugin-edges - 9 + 8 154 @@ -1806,63 +1806,63 @@

Test Report

plugin standard-test-plugin - 138 + 137 156 plugin standard-test-plugin-full-ignore - 239 + 241 157 plugin plugin-ignore-via-options - 123 + 126 158 plugin plugin-ignore-null - 124 + 123 159 plugin plugin-delegate-init - 124 + 123 160 plugin load-defaults - 124 + 123 161 plugin load-relative-to-root - 128 + 131 162 plugin good-default-options - 130 + 125 163 plugin bad-default-options - 24 + 20 164 @@ -1876,28 +1876,28 @@

Test Report

plugin should return "no errors created." when passing test false - 406 + 409 166 plugin should return "error caught!" when passing test true - 382 + 380 167 plugin works with exportmap - 123 + 125 168 plugin bad - 130 + 134 169 @@ -1911,21 +1911,21 @@

Test Report

plugin plugin-error-deprecated - 18 + 20 171 plugin plugin-error-add - 17 + 19 172 plugin plugin-error-act - 20 + 25 173 @@ -1939,21 +1939,21 @@

Test Report

plugin plugin-fix - 149 + 155 175 plugin export - 11 + 13 176 plugin handles plugin with action that timesout - 242 + 245 177 @@ -1967,21 +1967,21 @@

Test Report

plugin calling act from init actor is deprecated - 31 + 22 179 plugin plugin actions receive errors in callback function - 149 + 138 180 plugin dynamic-load-sequence - 354 + 355 181 @@ -1995,182 +1995,182 @@

Test Report

plugin plugin options can be modified by plugins during load sequence - 128 + 127 183 plugin plugin options can be modified by plugins during init sequence - 124 + 125 184 plugin plugin init can add actions for future init actions to call - 127 + 124 185 plugin plugin-init-error - 23 + 31 186 plugin plugin-extend-action-modifier - 133 + 167 187 plugin plugin-extend-logger - 122 + 119 188 plugin plugins-from-options - 128 + 127 189 plugin plugins-from-bad-options - 19 + 16 190 plugin plugins-options-precedence - 144 + 124 191 plugin error-plugin-define - 13 + 14 192 plugin error-plugin-init - 21 + 19 193 plugin error-plugin-action - 30 + 25 194 plugin no-name - 136 + 137 195 plugin seneca-prefix-wins - 127 + 125 196 plugin plugin-defaults-top-level-joi - 130 + 127 197 plugin plugin-order-task-args - 12 + 14 198 plugin plugin-defaults-function - 124 + 122 199 print init - 8 + 10 200 print options - 17 + 16 201 print print - 9 + 8 202 print custom-print - 18 + 15 203 prior happy - 35 + 25 204 prior top-level - 11 + 14 205 prior add-general-to-specific - 24 + 28 206 prior add-strict-general-to-specific - 32 + 18 207 prior add-specific-to-general - 14 + 16 208 @@ -2184,63 +2184,63 @@

Test Report

prior add-general-to-specific-alpha - 26 + 24 210 prior add-general-to-specific-reverse-alpha - 17 + 20 211 prior add-strict-default - 23 + 18 212 prior add-strict-true - 24 + 18 213 private exit_close - 388 + 379 214 ready ready_die - 121 + 120 215 ready ready_die_no_errhandler - 122 + 125 216 ready ready_null_name - 121 + 124 217 ready ready-complex - 264 + 272 218 @@ -2254,126 +2254,126 @@

Test Report

ready ready-error-test - 126 + 122 220 ready ready-event - 15 + 19 221 ready ready-both - 123 + 120 222 seneca --seneca.log arguments tests: --seneca.log=level:warn - 12 + 11 223 seneca --seneca.log arguments tests: --seneca.log=level:warn+ - 15 + 13 224 seneca --seneca.log arguments tests: --seneca.log.level.warn - 14 + 17 225 seneca --seneca.log arguments tests: --seneca.log.level.warn+ - 19 + 24 226 seneca --seneca.log arguments tests: duplicate param --seneca.log - 20 + 13 227 seneca --seneca.log arguments tests: incorrect arg --seneca.log=level: - 28 + 18 228 seneca --seneca.log arguments tests: incorrect arg --seneca.log.level.abc - 9 + 13 229 seneca --seneca.log arguments tests: incorrect arg --seneca.log.abc - 14 + 17 230 seneca --seneca.log aliases tests: --seneca.log.quiet - 15 + 18 231 seneca --seneca.log aliases tests: --seneca.log.silent - 23 + 14 232 seneca --seneca.log aliases tests: --seneca.log.all - 19 + 20 233 seneca --seneca.log aliases tests: --seneca.log.any - 17 + 19 234 seneca --seneca.log aliases tests: --seneca.log.print - 16 + 20 235 seneca --seneca.log aliases tests: --seneca.log.test - 14 + 16 236 seneca --seneca.log aliases tests: --seneca.log.standard - 19 + 20 237 @@ -2387,77 +2387,77 @@

Test Report

seneca --seneca.log aliases tests: --seneca.log.level.silent - 15 + 16 239 seneca --seneca.log aliases tests: --seneca.log.level.all - 17 + 26 240 seneca --seneca.log aliases tests: --seneca.log.level.any - 25 + 27 241 seneca --seneca.log aliases tests: --seneca.log.level.print - 13 + 15 242 seneca --seneca.log aliases tests: --seneca.log.level.test - 16 + 14 243 seneca --seneca.log aliases tests: --seneca.log.level.standard - 15 + 19 244 seneca happy - 29 + 24 245 seneca require-abbrev - 243 + 246 246 seneca version - 12 + 9 247 seneca tag - 13 + 16 248 seneca json-inspect - 18 + 15 249 @@ -2471,7 +2471,7 @@

Test Report

seneca happy-error - 15 + 13 251 @@ -2499,49 +2499,49 @@

Test Report

seneca action-act-invalid-args - 24 + 27 255 seneca action-default - 21 + 59 256 seneca action-override - 127 + 146 257 seneca action-callback-args - 20 + 15 258 seneca action-extend - 157 + 128 259 seneca prior-nocache - 347 + 346 260 seneca gating - 121 + 122 261 @@ -2555,14 +2555,14 @@

Test Report

seneca loading-plugins - 148 + 155 263 seneca fire-and-forget - 12 + 13 264 @@ -2576,28 +2576,28 @@

Test Report

seneca string-add - 25 + 22 266 seneca fix-basic - 10 + 23 267 seneca act-history - 51 + 54 268 seneca wrap - 50 + 43 269 @@ -2611,91 +2611,91 @@

Test Report

seneca strict-result - 12 + 13 271 seneca add-noop - 16 + 12 272 seneca supports jsonic params to has - 8 + 13 273 seneca supports a function to trace actions - 24 + 22 274 seneca supports true to be passed as trace action option - 18 + 20 275 seneca strict-find-false - 16 + 17 276 seneca strict-find-true - 17 + 18 277 seneca strict-find-default - 15 + 17 278 seneca catchall-pattern - 122 + 121 279 seneca memory - 362 + 356 280 seneca use-shortcut - 48 + 34 281 seneca status-log - 32 + 39 282 seneca reply-seneca - 136 + 138 283 @@ -2709,140 +2709,140 @@

Test Report

seneca order - 13 + 10 285 seneca #decorate can add a property to seneca - 14 + 13 286 seneca #decorate cannot override core property - 15 + 19 287 seneca #decorate cannot overwrite a decorated property - 14 + 12 288 seneca #decorate cannot prefix a property with an underscore - 19 + 15 289 seneca #intercept intercept - 23 + 31 290 sequence single-add-act - 16 + 17 291 sequence double-add-act - 19 + 21 292 sequence single-add-act-ready - 124 + 122 293 sequence single-add-act-gate-action - 23 + 19 294 sequence single-add-act-gate-instance - 30 + 20 295 smoke seneca-smoke - 24 + 15 296 options options-happy - 123 + 122 297 options options-getset - 124 + 122 298 options options-legacy - 122 + 123 299 options options-file-js - 122 + 125 300 options legacy-options-file-js - 122 + 124 301 options options-file-json - 126 + 125 302 options options-file-json-nomore - 121 + 125 303 options options-env - 124 + 122 304 @@ -2856,14 +2856,14 @@

Test Report

sub happy-sub - 20 + 22 306 sub inwards-outwards-sub - 43 + 37 307 @@ -2884,7 +2884,7 @@

Test Report

sub mixed-sub - 27 + 34 310 @@ -2898,21 +2898,21 @@

Test Report

sub sub-close - 122 + 123 312 sub sub-fix - 24 + 19 313 sub sub-once - 126 + 120 314 @@ -2926,182 +2926,182 @@

Test Report

timeout error-handler - 124 + 123 316 timeout should accept a timeout value from options - 240 + 238 317 transport happy-nextgen - 389 + 386 318 transport config-legacy-nextgen - 484 + 479 319 transport error-nextgen - 370 + 374 320 transport interop-nextgen - 274 + 275 321 transport config-nextgen - 507 + 509 322 transport nextgen-transport-local-override - 371 + 370 323 transport nextgen-meta - 376 + 381 324 transport nextgen-ordering - 492 + 491 325 transport transport-exact-single - 165 + 171 326 transport transport-local-override - 154 + 152 327 transport transport-star - 276 + 286 328 transport transport-star-pin-object - 277 + 275 329 transport transport-single-notdef - 165 + 178 330 transport transport-pins-notdef - 179 + 178 331 transport transport-single-wrap-and-star - 292 + 291 332 transport transport-local-single-and-star - 278 + 282 333 transport transport-local-over-wrap - 248 + 244 334 transport transport-local-prior-wrap - 163 + 169 335 transport transport-init-ordering - 247 + 246 336 transport transport-no-plugin-init - 288 + 279 337 transport transport-balance-exact - 897 + 903 338 transport multi-layer-error - 720 + 727 339 transport server can be restarted without issues to clients - 660 + 619 340 transport transport-listen supports-null-options - 129 + 127 341 @@ -3122,56 +3122,56 @@

Test Report

transport transport-listen supports the port number as an argument - 123 + 126 344 transport transport-listen supports the port number and host as an argument - 124 + 126 345 transport transport-listen supports the port number, host, and path as an argument - 130 + 127 346 transport transport-listen action-error - 125 + 129 347 transport client() supports null options - 127 + 125 348 util seneca.util.deepextend.happy - 2 + 1 349 util seneca.util.deepextend.types with new - 1 + 2 350 util seneca.util.deepextend.types - 1 + 2 351 @@ -3192,14 +3192,14 @@

Test Report

xward happy-inward - 19 + 15 354 xward happy-outward - 23 + 21 @@ -3822,7 +3822,7 @@

seneca.js

98 - err: false + err: false, 99 @@ -22045,13 +22045,13 @@

lib/common.js

677 - 59651 + 59900 var s = 0 678 - 59651 + 59900 var e = i @@ -22063,13 +22063,13 @@

lib/common.js

680 - 59651 + 59900 if (0 === this._list.length) { 681 - 9673 + 9842 return 0 @@ -22087,13 +22087,13 @@

lib/common.js

684 - 49978 + 50058 do { 685 - 103814 + 103948 i = Math.floor((s + e) / 2) @@ -22105,31 +22105,31 @@

lib/common.js

687 - 103814 + 103948 if (timelimit > this._list[i].timelimit) { 688 - 214 + 212 s = i + 1 689 - 214 + 212 i = s 690 - 103600 + 103736 } else if (timelimit < this._list[i].timelimit) { 691 - 103589 + 103725 e = i @@ -22171,7 +22171,7 @@

lib/common.js

698 - 49978 + 50058 return i @@ -22207,13 +22207,13 @@

lib/common.js

704 - 59641 + 59890 for (var j = 0; j < i; j++) { 705 - 408 + 412 delete this._map[this._list[j].id] @@ -22225,7 +22225,7 @@

lib/common.js

707 - 59641 + 59890 this._list = this._list.slice(i) @@ -27234,7 +27234,7 @@

lib/logging.js

60 - + 61 @@ -27624,7 +27624,7 @@

lib/logging.js

125 -
if(entry.err &&
opts.debug.print.err
) {
+
if (entry.err &&
opts.debug.print.err
) {
126 @@ -31795,7 +31795,7 @@

lib/outward.js

56 - 2389 + 2390 actdetails.result.push({ when: Date.now(), res: res })