How to use the @node-red/util.log.log function in @node-red/util

To help you get started, we’ve selected a few @node-red/util examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github node-red / node-red / packages / node_modules / @node-red / runtime / lib / nodes / Node.js View on Github external
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);
}
github node-red / node-red / packages / node_modules / @node-red / runtime / lib / nodes / Node.js View on Github external
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);
}
github node-red / node-red / packages / node_modules / @node-red / runtime / lib / nodes / Node.js View on Github external
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);
}
/**
github node-red / node-red / packages / node_modules / @node-red / runtime / lib / nodes / flows / util.js View on Github external
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;
    }
}
github node-red / node-red / packages / node_modules / @node-red / runtime / lib / nodes / Node.js View on Github external
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);
}