Added more logging

This commit is contained in:
Emad-salah 2019-12-10 02:10:15 +01:00 committed by GitHub
parent 0e244af525
commit e3a1a1f454

View file

@ -404,10 +404,10 @@ module.exports = (
success: false success: false
}); });
} }
logger.debug("initWallet:", initWalletResponse); logger.info("initWallet:", initWalletResponse);
const waitUntilFileExists = seconds => { const waitUntilFileExists = seconds => {
logger.debug( logger.info(
`Waiting for admin.macaroon to be created. Seconds passed: ${seconds}` `Waiting for admin.macaroon to be created. Seconds passed: ${seconds}`
); );
setTimeout(async () => { setTimeout(async () => {
@ -419,9 +419,8 @@ module.exports = (
return waitUntilFileExists(seconds + 1); return waitUntilFileExists(seconds + 1);
} }
logger.debug("admin.macaroon file created"); logger.info("admin.macaroon file created");
mySocketsEvents.emit("updateLightning");
await LightningServices.init(); await LightningServices.init();
const token = await auth.generateToken(); const token = await auth.generateToken();
@ -434,6 +433,7 @@ module.exports = (
} }
}); });
} catch (err) { } catch (err) {
console.error(err);
res.status(400).json({ res.status(400).json({
field: "unknown", field: "unknown",
errorMessage: sanitizeLNDError(err.message) errorMessage: sanitizeLNDError(err.message)
@ -1400,4 +1400,4 @@ module.exports = (
* Return app so that it can be used by express. * Return app so that it can be used by express.
*/ */
// return app; // return app;
} }