Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Commit

Permalink
Adjust to new log() parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
bhs committed Sep 14, 2016
1 parent 3ad9b36 commit 5f43e5c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/examples/demo/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ setTimeout(() => {
const child = tracer.startSpan('child_span', { childOf: parent });
child.setTag('alpha', '200');
child.setTag('beta', '50');
child.log({state: "waiting"})

console.log('Waiting...');
setTimeout(() => {
console.log('Finishing child and parent.')
child.log({state: "done"})
child.finish();
parent.finish();

Expand Down
7 changes: 5 additions & 2 deletions src/mock_tracer/mock_span.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ export default class MockSpan extends opentracing.Span {
}
}

_log(fields) {
this._logs.push(fields);
_log(fields, timestamp) {
this._logs.push({
fields : fields,
timestamp : timestamp,
});
}

_finish(finishTime) {
Expand Down
6 changes: 5 additions & 1 deletion test/api_compatibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ module.exports = function apiCompatibilityChecks(tracerFactory, options) {
{name: 'setTag', args: ['key', 'value'], chainable: true},
{name: 'addTags', args: [{'key': 'value'}], chainable: true},
{name: 'log', args: [
{'event': 'event-name', 'payload': {'key': 'value'}}
{'key1': 'val1', 'key2': {'nested': 'value'}}
], chainable: false},
{name: 'log', args: [
{'key1': 'val1', 'key2': {'nested': 'value'}},
Date.now(),
], chainable: false},
{name: 'logEvent', args: ['eventName', null], chainable: false},
{name: 'logEvent', args: ['eventName', {'key': 'value'}], chainable: false},
Expand Down

0 comments on commit 5f43e5c

Please sign in to comment.