Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var o = {
level: level,
id: self.id,
type: self.type,
msg: msg
};
if (self._alias) {
o._alias = self._alias;
}
if (self.z) {
o.z = self.z;
}
if (self.name) {
o.name = self.name;
}
Log.log(o);
}
Node.prototype.metric = function(eventname, msg, metricValue) {
if (typeof eventname === "undefined") {
return Log.metric();
}
var metrics = {};
metrics.level = Log.METRIC;
metrics.nodeid = this.id;
metrics.event = "node."+this.type+"."+eventname;
metrics.msgid = msg._msgid;
metrics.value = metricValue;
Log.log(metrics);
}
var o = {
level: level,
id: self.id,
type: self.type,
msg: msg
};
if (self._alias) {
o._alias = self._alias;
}
if (self.z) {
o.z = self.z;
}
if (self.name) {
o.name = self.name;
}
Log.log(o);
}
/**
var type = config.type;
try {
var nodeTypeConstructor = typeRegistry.get(type);
if (nodeTypeConstructor) {
var conf = clone(config);
delete conf.credentials;
for (var p in conf) {
if (conf.hasOwnProperty(p)) {
mapEnvVarProperties(conf,p,flow);
}
}
try {
Object.defineProperty(conf,'_flow', {value: flow, enumerable: false, writable: true })
newNode = new nodeTypeConstructor(conf);
} catch (err) {
Log.log({
level: Log.ERROR,
id:conf.id,
type: type,
msg: err
});
}
} else {
Log.error(Log._("nodes.flow.unknown-type", {type:type}));
}
} catch(err) {
Log.error(err);
}
return newNode;
}
}
.catch(function(err) {
log.log('[SSHKey generation] error:', err);
throw err;
});
}
Node.prototype.metric = function(eventname, msg, metricValue) {
if (typeof eventname === "undefined") {
return Log.metric();
}
var metrics = {};
metrics.level = Log.METRIC;
metrics.nodeid = this.id;
metrics.event = "node."+this.type+"."+eventname;
metrics.msgid = msg._msgid;
metrics.value = metricValue;
Log.log(metrics);
}