How to use the @node-red/util.log.ERROR 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 / flows / util.js View on Github external
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.error = function(logMessage,msg) {
    if (typeof logMessage != 'boolean') {
        logMessage = logMessage || "";
    }
    var handled = false;
    if (msg && typeof msg === 'object') {
        handled = this._flow.handleError(this,logMessage,msg);
    }
    if (!handled) {
        log_helper(this, Log.ERROR, logMessage);
    }
};
github node-red / node-red / packages / node_modules / @node-red / runtime / lib / nodes / Node.js View on Github external
Node.prototype.error = function(logMessage,msg) {
    if (typeof logMessage != 'boolean') {
        logMessage = logMessage || "";
    }
    var handled = false;
    if (msg) {
        handled = this._flow.handleError(this,logMessage,msg);
    }
    if (!handled) {
        log_helper(this, Log.ERROR, logMessage);
    }
};