How to use the signale.log function in signale

To help you get started, we’ve selected a few signale 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 marmelab / web-myna / cli / index.js View on Github external
'The configuration of Web Myna is completed and saved. You can restart it, everything should work!',
            );
        } catch (error) {
            signale.log(`Error when saving your configuration of the ${configurationLocation.configPath} file.`);
            signale.error(error);
        }
        process.exit();
    };

    run();
} else {
    const missingTokens = getMissingEnvironmentTokens();

    if (missingTokens.length) {
        const message = getMissingTokensMessage(config, missingTokens);
        signale.log(boxen(message, { padding: 1, margin: 1, borderColor: 'red', align: 'center' }));
        process.exit();
    } else {
        app.listen(config.proxyPort, () => {
            signale.info(`Web Myna is starded on port ${config.proxyPort} in environment ${config.env}`);
        });
    }
}

process.on('SIGINT', function() {
    clear();
    signale.log(chalk.yellow(figlet.textSync('Bye', { horizontalLayout: 'full' })));
    process.exit();
});
github marmelab / web-myna / cli / index.js View on Github external
configureApi = apiConfiguration.continue;
        }

        clearWn();
        const finalConfiguration = {
            recordingsPath: configurationLocation.recordingsPath,
            apis,
        };
        try {
            if (!fs.existsSync(configurationLocation.recordingsPath)) {
                fs.mkdirSync(configurationLocation.recordingsPath);
            }
            fs.writeFileSync(configurationLocation.configPath, JSON.stringify(finalConfiguration, null, 2), {
                encoding: 'utf8',
            });
            signale.log(
                'The configuration of Web Myna is completed and saved. You can restart it, everything should work!',
            );
        } catch (error) {
            signale.log(`Error when saving your configuration of the ${configurationLocation.configPath} file.`);
            signale.error(error);
        }
        process.exit();
    };
github marmelab / web-myna / cli / index.js View on Github external
const run = async () => {
        const configurationLocation = await questions.askConfigurationLocation();

        displayApiHelp();
        let apis = [];
        let configureApi = true;
        while (configureApi) {
            if (apis.length) {
                signale.log(`You already have ${apis.length} api.s configured`);
            }
            const apiConfiguration = await questions.askApiConfiguration();
            apis.push(omit(apiConfiguration, ['continue']));
            configureApi = apiConfiguration.continue;
        }

        clearWn();
        const finalConfiguration = {
            recordingsPath: configurationLocation.recordingsPath,
            apis,
        };
        try {
            if (!fs.existsSync(configurationLocation.recordingsPath)) {
                fs.mkdirSync(configurationLocation.recordingsPath);
            }
            fs.writeFileSync(configurationLocation.configPath, JSON.stringify(finalConfiguration, null, 2), {
github marmelab / web-myna / cli / index.js View on Github external
const clearWn = () => {
    clear();
    signale.log(chalk.yellow(figlet.textSync('Web Myna', { horizontalLayout: 'full' })));
};
github hummal / crittr / src / classes / Crittr.class.js View on Github external
page.on("error", err => {
                        log.log("Error: " + err.toString());
                    });
                }