connection .authenticate() .then(() => { console.info('INFO - Database connected.') }) .catch(err => { console.error('ERROR - Unable to connect to the database:', err) })
filterTokens(params, "fence", function forToken(token) { if (!token.info.trim()) { addErrorContext(onError, token.lineNumber, token.line); } });
format() { if (this.state.submitted) { let values = this.choices.map(ch => this.styles.info(ch.index)); return values.join(', '); } return ''; }
function logStreamError (logger, err, res) { if (err.code === 'ERR_STREAM_PREMATURE_CLOSE') { if (!logger[kDisableRequestLogging]) { logger.info({ res }, 'stream closed prematurely') } } else { logger.warn({ err }, 'response terminated with an error with headers already sent') } }
var onRenderTargetDispose = function ( event ) { var renderTarget = event.target; renderTarget.removeEventListener( 'dispose', onRenderTargetDispose ); deallocateRenderTarget( renderTarget ); _this.info.memory.textures --; }
/** * @public * @description This function starts the service * @example * gladys.services.usb.start(); */ async function start() { logger.info('Starting usb service'); }
// Save a compose cache every time the app is ready, this allows us to // run faster tooling commands app.events.on('ready', () => { lando.cache.set(composeCache, { name: app.name, project: app.project, compose: app.compose, root: app.root, info: app.info, }, {persist: true}); });
// Copy _.forEach(buildCopy, item => { _.forEach(item.src, dir => { const dest = (item.direct) ? item.dest : path.join(item.dest, path.basename(dir)); fs.copySync(dir, dest, {overwrite: true}); log.info('Copied source from %s to %s', dir, dest); }); });
/* * Post new meta data for metrics. */ api.post('/metrics/v2/:id', handler((req, res) => { return Promise.map(plugins, plugin => { const reporter = new plugin.Reporter(config[plugin.config]); return reporter.ping() .then(() => reporter.report(_.merge({}, req.body, {instance: req.params.id}))) .then(() => log.info('Reported to %s', plugin.name)) .then(() => reporter.close()); }); }));
* show() { this.ctx.body = 'hello'; this.logger.debug('debug'); this.logger.info('appname: %s', this.config.name); this.logger.warn('warn'); this.logger.error(new Error('some error')); }
app.init().then(() => { if (_.isNull(user)) user = getUser(service, app.info); return lando.engine.run(utils.buildCommand(app, command, service, user)).catch(error => { error.hide = true; throw error; }); })
async function main() { const store = createStore(reducer, applyMiddleware(reduxMiddleware)); console.info('Popup: Init bridge and restore state...'); await bridge().init(window.browser ? window.browser : window.chrome, !!window.browser, store); console.info('Popup: Creating React app...'); ReactDOM.render(<Provider store={store}><App /></Provider>, document.getElementById('root')); }
// Categorize and colorize URLS if and as appropriate _.forEach(app.info, info => { if (_.has(info, 'urls') && !_.isEmpty(info.urls)) { urls[info.service] = _.filter(app.urls, item => { item.theme = chalk[item.color](item.url); return _.includes(info.urls, item.url); }); } });
async restoreState() { const s = await this.storageGet(null); console.info('Popup: Restoring saved state:', s); if (!s) return; if (s.selectedFolderId) this.dispatch({ type: 'SELECTED_FOLDER_SET', id: s.selectedFolderId }); }
resultPromise.then(function(response) { console.info(`RESULT: ${JSON.stringify(response)}`); callback(null, { 'statusCode': 200, 'body': JSON.stringify(response) }); }).catch(function(err) { console.error(err); callback(err); });