How to use the sails.log function in sails

To help you get started, we’ve selected a few sails 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 pantsel / konga / bin / konga.js View on Github external
args,
        {cwd : path.join(__dirname,".."), stdio: "inherit"});
    cmd.on('exit', function(code){
        console.log("Exiting",code);
    });
}
else if(argv._[0] === 'prepare') {

  // Validate node version
  const Utils = require('../api/services/Utils');
  if(!Utils.isRuntimeVersionSupported()) {
    console.error("Incompatible Node.js version. Please make sure that you have Node.js >= 8 installed.")
    process.exit(1);
  }

  Sails.log("Preparing database...")

  if(!process.env.DB_ADAPTER && !argv.adapter) {
    Sails.log.error("No db adapter defined. Set --adapter {mongo || mysql || postgres || sql-srv}")
    return process.exit(1);
  }

  if(!process.env.DB_URI && !argv.uri) {
    Sails.log.error("No db connection string is defined. Set --uri {db_connection_string}")
    return process.exit(1);
  }

  process.env.DB_ADAPTER = process.env.DB_ADAPTER || argv.adapter;
  process.env.DB_URI = process.env.DB_URI || argv.uri;
  process.env.PORT = _.isString(argv.port) || _.isNumber(argv.port) ? argv.port : 1339;

  require("../makedb")(function(err) {