Skip to content

Commit

Permalink
Merge pull request #695 from Agoric/mfig/clean-up-logging
Browse files Browse the repository at this point in the history
Remove some verbose logging
  • Loading branch information
michaelfig authored Mar 16, 2020
2 parents 8120a03 + 104654a commit 142b5c9
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 19 deletions.
2 changes: 1 addition & 1 deletion packages/SwingSet/src/kernel/vatManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ export default function makeVatManager(
return process(
() => dispatch[dispatchOp](...dispatchArgs),
() => transcriptFinishDispatch(),
err => console.log(`doProcess: ${errmsg}: ${err}`, err),
err => console.log(`doProcess: ${errmsg}:`, err),
);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/SwingSet/src/vats/comms/clist.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export function mapInbound(state, remoteID, s) {
const promiseID = allocateUnresolvedPromise(state, remoteID);
remote.fromRemote.set(s, promiseID);
remote.toRemote.set(promiseID, s);
console.log(`inbound promise ${s} mapped to ${promiseID}`);
// console.log(`inbound promise ${s} mapped to ${promiseID}`);
}
} else {
throw new Error(`unknown type ${type}`);
Expand Down
6 changes: 3 additions & 3 deletions packages/SwingSet/src/vats/comms/dispatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function buildCommsDispatch(syscall, _state, _helpers) {

function notifyFulfillToData(promiseID, data) {
insistCapData(data);
console.log(`comms.notifyFulfillToData(${promiseID})`);
// console.log(`comms.notifyFulfillToData(${promiseID})`);
// dumpState(state);

// I *think* we should never get here for local promises, since the
Expand All @@ -91,14 +91,14 @@ export function buildCommsDispatch(syscall, _state, _helpers) {
}

function notifyFulfillToPresence(promiseID, slot) {
console.log(`comms.notifyFulfillToPresence(${promiseID}) = ${slot}`);
// console.log(`comms.notifyFulfillToPresence(${promiseID}) = ${slot}`);
const resolution = harden({ type: 'object', slot });
resolvePromiseToRemote(syscall, state, promiseID, resolution, transmit);
}

function notifyReject(promiseID, data) {
insistCapData(data);
console.log(`comms.notifyReject(${promiseID})`);
// console.log(`comms.notifyReject(${promiseID})`);
const resolution = harden({ type: 'reject', data });
resolvePromiseToRemote(syscall, state, promiseID, resolution, transmit);
}
Expand Down
15 changes: 9 additions & 6 deletions packages/cosmic-swingset/lib/ag-solo/outbound.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,32 @@ const knownTargets = new Map(); // target => { deliverator, highestSent, highest

export function deliver(mbs) {
const data = mbs.exportToData();
console.log(`deliver`, data);
// console.log(`deliver`, data);
for (const target of Object.getOwnPropertyNames(data)) {
if (!knownTargets.has(target)) {
console.log(`eek, no delivery method for target ${target}`);
// eslint-disable-next-line no-continue
continue;
}
const t = knownTargets.get(target);
const newMessages = [];
data[target].outbox.forEach(m => {
const [msgnum, body] = m;
const [msgnum] = m;
if (msgnum > t.highestSent) {
console.log(`new outbound message ${msgnum} for ${target}: ${body}`);
// console.log(`new outbound message ${msgnum} for ${target}: ${body}`);
newMessages.push(m);
}
});
newMessages.sort((a, b) => a[0] - b[0]);
console.log(` ${newMessages.length} new messages`);
// console.log(` ${newMessages.length} new messages`);
const acknum = data[target].inboundAck;
if (newMessages.length || acknum !== t.highestAck) {
console.log(` invoking deliverator`);
console.log(
` invoking deliverator; ${newMessages.length} new messages for ${target}`,
);
t.deliverator(newMessages, acknum);
if (newMessages.length) {
t.highestSent = newMessages[newMessages.length - 1][0];
[t.highestSent] = newMessages[newMessages.length - 1];
}
t.highestAck = acknum;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/cosmic-swingset/lib/ag-solo/vats/vat-wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function build(E, D, _log) {
}

function setPresences() {
console.log(`subscribing to walletPurseState`);
// console.log(`subscribing to walletPurseState`);
// This provokes an immediate update
purseSubscribe(
harden({
Expand All @@ -102,7 +102,7 @@ function build(E, D, _log) {
}),
);

console.log(`subscribing to walletInboxState`);
// console.log(`subscribing to walletInboxState`);
// This provokes an immediate update
inboxSubscribe(
harden({
Expand Down
15 changes: 9 additions & 6 deletions packages/cosmic-swingset/lib/launch-chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,18 @@ export async function launch(kernelStateDBDir, mailboxStorage, vatsDir, argv) {
if (!mb.deliverInbound(sender, messages, ack)) {
return;
}
console.log(`mboxDeliver: ADDED messages`);
// console.log(`mboxDeliver: ADDED messages`);
await controller.run();
}

async function beginBlock(blockHeight, blockTime) {
const addedToQueue = timer.poll(blockTime);
console.log(
`polled; blockTime:${blockTime}, h:${blockHeight} ADDED: ${addedToQueue}`,
);
async function beginBlock(_blockHeight, blockTime) {
// const addedToQueue = timer.poll(blockTime);
// console.log(
// `polled; blockTime:${blockTime}, h:${blockHeight} ADDED: ${addedToQueue}`,
// );
if (!timer.poll(blockTime)) {
return;
}
await controller.run();
}

Expand Down

0 comments on commit 142b5c9

Please sign in to comment.