How to use the @node-red/util.log.info 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 / context / index.js View on Github external
} else if (defaultName) {
                // No 'default' listed, so pick first in list as the default
                stores["_"] = stores[defaultName];
                defaultStore = defaultName;
                defaultIsAlias = true;
            } else {
                // else there were no stores list the config object - fall through
                // to below where we default to a memory store
                storeList = ["memory"];
                defaultStore = "memory";
            }
            hasConfiguredStore = true;
            storeList = Object.keys(stores).filter(n=>!(defaultIsAlias && n==="default") && n!== "_");
        } else {
            // No configured plugins
            log.info(log._("context.log-store-init", {name:"default", info:"module=memory"}));
            promises.push(stores["_"].open())
            storeList = ["memory"];
            defaultStore = "memory";
        }
        return resolve(Promise.all(promises));
    }).catch(function(err) {
        throw new Error(log._("context.error-loading-module",{message:err.toString()}));
github node-red / node-red / packages / node_modules / @node-red / runtime / lib / storage / localfilesystem / util.js View on Github external
});
                        return;
                    } catch(backupStatErr) {
                        // Empty flow file, no back-up file
                        return resolve(emptyResponse);
                    }
                }
                try {
                    return resolve(parseJSON(data));
                } catch(parseErr) {
                    log.warn(log._("storage.localfilesystem.invalid",{type:type}));
                    return resolve(emptyResponse);
                }
            } else {
                if (type === 'flow') {
                    log.info(log._("storage.localfilesystem.create",{type:type}));
                }
                resolve(emptyResponse);
            }
        });
    });
github node-red / node-red / packages / node_modules / @node-red / runtime / lib / storage / localfilesystem / projects / index.js View on Github external
function getFlows() {
    if (!initialFlowLoadComplete) {
        initialFlowLoadComplete = true;
        log.info(log._("storage.localfilesystem.user-dir",{path:settings.userDir}));
        if (activeProject) {
            // At this point activeProject will be a string, so go load it and
            // swap in an instance of Project
            return loadProject(activeProject).then(function() {
                log.info(log._("storage.localfilesystem.projects.active-project",{project:activeProject.name||"none"}));
                log.info(log._("storage.localfilesystem.flows-file",{path:flowsFullPath}));
                return getFlows();
            });
        } else {
            if (projectsEnabled) {
                log.warn(log._("storage.localfilesystem.projects.no-active-project"))
            } else {
                projectLogMessages.forEach(log.warn);
            }
            log.info(log._("storage.localfilesystem.flows-file",{path:flowsFullPath}));
        }
github node-red / node-red / packages / node_modules / @node-red / runtime / lib / storage / localfilesystem / projects / index.js View on Github external
return loadProject(activeProject).then(function() {
                log.info(log._("storage.localfilesystem.projects.active-project",{project:activeProject.name||"none"}));
                log.info(log._("storage.localfilesystem.flows-file",{path:flowsFullPath}));
                return getFlows();
            });
        } else {