1.2.1 • Published 8 years ago

chainbuilder-log-console v1.2.1

Weekly downloads
3
License
ISC
Repository
github
Last release
8 years ago

chainbuilder-log-console Build Status

A console logger for chainbuilder.

Installation npm install chainbuilder chainbuilder-log-console --save

Usage

var chainBuilder = require('chainbuilder');

var myChain = chainBuilder({
  methods: {
    /* ... your methods ... */
  },
  mixins: [
    require('chainbuilder-log-console')({
      // logs to debug instead of directly to console
      log: require('debug')('chainbuilder'),
      // includes args and results in output
      detailed: true,
      // experimental!
      colors: true
    })
  ]
});

Example detailed output

┬ ⟸  3
│
├→ $beginWhile()
│ ┬ ⟸  3
│ │
│ ├→ plus(1)
│ │← 4                               0ms
│ │
│ ├→ times(3)
│ │← 12                              2ms
│ │
│ ┴ ⟹  12
│ ┬ ⟸  12
│ │
│ ├→ plus(1)
│ │← 13                              0ms
│ │
│ ├→ times(3)
│ │← 39                              2ms
│ │
│ ┴ ⟹  39
│← 39                                4ms
│
├→ plus(1)
│← 40                                0ms
│
┴ ⟹  40

Key:

symboldescription
┬ ⟸ 12initial value (of 12)
┴ ⟹ "onetwo"result (of 'onetwo')
├→ plus(1)call (of plus(1))
│⤸ plus(1)skipped call (because a previous call errored)
│← 1successful result (of 1)
│✕ BANGcall resulted in an error (of new Error('BANG'))

block call of $beginMap/$endMap with result [4,6], and an iteration with initial value of 2:

├→ $beginMap()
...
│ ┬ ⟸  2
│ ├→ plus(2)
│ │← 12
│ ┴ ⟹  4
...
│← [4,6]
1.2.1

8 years ago

1.2.0

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago