How to use the node-red/red/runtime/log.js.ERROR function in node-red

To help you get started, we’ve selected a few node-red 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 BiancoRoyal / node-red-contrib-modbus / src / testing / nodered-helper.js View on Github external
load: function (testNode, testFlows, testCredentials, cb) {
    logSpy = sinon.spy(log, 'log')
    logSpy.FATAL = log.FATAL
    logSpy.ERROR = log.ERROR
    logSpy.WARN = log.WARN
    logSpy.INFO = log.INFO
    logSpy.DEBUG = log.DEBUG
    logSpy.TRACE = log.TRACE
    logSpy.METRIC = log.METRIC

    if (typeof testCredentials === 'function' || !cb) {
      cb = testCredentials
      testCredentials = {}
    }

    var storage = {
      getFlows: function () {
        var defer = when.defer()
        defer.resolve(testFlows)
        return defer.promise