Skip to content

Commit

Permalink
feat: pass bundle path to ycb for improved logging (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
BillDorn authored Aug 31, 2020
1 parent fc9ba0b commit ad066a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,16 @@ function contentsIsYCB(contents) {
* @param {Config} config The config object.
* @param {object} dimensions The dimensions definitions.
* @param {array} contents The contents of the YCB file.
* @param {string} path The path of the YCB file.
* @return {YCB} The YCB object.
*/
function makeYCB(config, dimensions, contents) {
function makeYCB(config, dimensions, contents, path) {
var ycbBundle,
ycb;
contents = contents || {};
ycbBundle = [{dimensions: dimensions}];
ycbBundle = ycbBundle.concat(clone(contents));
ycb = new libycb.Ycb(ycbBundle);
ycb = new libycb.Ycb(ycbBundle, {logContext: path});
return ycb;
}

Expand Down Expand Up @@ -556,7 +557,7 @@ Config.prototype = {
var ycb;

if (dimensions) {
ycb = makeYCB(this, dimensions, contents);
ycb = makeYCB(this, dimensions, contents, path);
} else {
ycb = makeFakeYCB(dimensions, contents);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"homepage": "https://github.com/yahoo/ycb-config",
"dependencies": {
"ycb": "^2.1.1",
"ycb": "^2.1.2",
"json5": "~2.1.3",
"yamljs": "^0.3.0",
"deep-freeze": "~0.0.1"
Expand Down

0 comments on commit ad066a1

Please sign in to comment.