Commit 7c1b9abb1401216b0a7325dfb2213933eda8826a
Merge pull request #12 from dfinity/debug
add debugNorton Wang authored on 5/8/2018, 4:32:11 PM
GitHub committed on 5/8/2018, 4:32:11 PM
Parent: 65253852ce4bba2ee5342f055ebaf1a4a27d6ffe
Parent: e017d4e42f620b5ba0800e23649089033808a860
Files changed
actor.js | changed |
index.js | changed |
package-lock.json | changed |
package.json | changed |
actor.js | ||
---|---|---|
@@ -1,6 +1,7 @@ | ||
1 | 1 … | const errors = require('./errors.json') |
2 | 2 … | const nope = () => {} |
3 … | +const debug = require('debug')('lifecycle:error') | |
3 | 4 … | |
4 | 5 … | module.exports = class Actor { |
5 | 6 … | /** |
6 | 7 … | * the Actor manages the various message passing functions and provides |
@@ -54,8 +55,9 @@ | ||
54 | 55 … | try { |
55 | 56 … | this.currentMessage = message |
56 | 57 … | await this.container.onMessage(message) |
57 | 58 … | } catch (e) { |
59 … | + debug(e) | |
58 | 60 … | message.emit('execution:error', e) |
59 | 61 … | } |
60 | 62 … | message.emit('done', this) |
61 | 63 … | } |
index.js | ||
---|---|---|
@@ -2,8 +2,10 @@ | ||
2 | 2 … | const Actor = require('./actor.js') |
3 | 3 … | const Scheduler = require('./scheduler.js') |
4 | 4 … | const {decoder, generateId, ModuleRef, ActorRef} = require('primea-objects') |
5 | 5 … | |
6 … | +const debug = require('debug')('lifecycle:createActor') | |
7 … | + | |
6 | 8 … | module.exports = class Hypervisor { |
7 | 9 … | /** |
8 | 10 … | * The Hypervisor manages module instances by instantiating them and |
9 | 11 … | * destroying them when possible. It also facilitates locating Containers |
@@ -100,8 +102,10 @@ | ||
100 | 102 … | */ |
101 | 103 … | createActor (modRef, id = {nonce: this.nonce++, parent: null}) { |
102 | 104 … | const actorId = generateId(id) |
103 | 105 … | const metaData = [modRef.type, 0] |
106 … | + debug('new id', actorId.toJSON()) | |
107 … | + debug(modRef.toJSON()) | |
104 | 108 … | |
105 | 109 … | // save the container in the state |
106 | 110 … | this.tree.set(actorId.id, metaData).then(node => { |
107 | 111 … | // save the code |
package-lock.json | ||
---|---|---|
The diff is too large to show. Use a local git client to view these changes. Old file size: 350853 bytes New file size: 353282 bytes |
package.json | ||
---|---|---|
@@ -29,8 +29,9 @@ | ||
29 | 29 … | "contributors": "Alex Beregszaszi <alex@rtfs.hu>", |
30 | 30 … | "license": "MPL-2.0", |
31 | 31 … | "dependencies": { |
32 | 32 … | "binary-search-insert": "^1.0.3", |
33 … | + "debug": "^3.1.0", | |
33 | 34 … | "events": "^2.0.0", |
34 | 35 … | "primea-objects": "0.0.9", |
35 | 36 … | "safe-buffer": "^5.1.2" |
36 | 37 … | }, |
Built with git-ssb-web