Merge pull request #55 from shocknet/logging-fix

use logger
This commit is contained in:
Daniel Lugo 2020-04-04 16:54:58 -04:00 committed by GitHub
commit d6c73ea4b2
2 changed files with 5 additions and 5 deletions

View file

@ -212,7 +212,7 @@ module.exports = async (
app.use((req, res, next) => { app.use((req, res, next) => {
const deviceId = req.headers["x-shockwallet-device-id"]; const deviceId = req.headers["x-shockwallet-device-id"];
console.log("Decrypting route...") logger.debug("Decrypting route...")
try { try {
if (nonEncryptedRoutes.includes(req.path)) { if (nonEncryptedRoutes.includes(req.path)) {
return next(); return next();
@ -1671,7 +1671,7 @@ module.exports = async (
try { try {
const user = require('../services/gunDB/Mediator').getUser() const user = require('../services/gunDB/Mediator').getUser()
const data = await timeout5(user.get(Key.BIO).then()) const data = await timeout5(user.get(Key.BIO).then())
console.log(data) logger.debug(data)
res.json({ res.json({
data data
}) })

View file

@ -77,10 +77,10 @@ const server = program => {
const dataHash = hashData(args[0]).slice(-8) const dataHash = hashData(args[0]).slice(-8)
res.set('ETag', dataHash) res.set('ETag', dataHash)
console.log('ETag:', req.headers.etag) logger.debug('ETag:', req.headers.etag)
console.log('Data Hash:', dataHash) logger.debug('Data Hash:', dataHash)
if (req.headers.etag === dataHash) { if (req.headers.etag === dataHash) {
console.log('Same Hash Detected!') logger.debug('Same Hash Detected!')
args[0] = null args[0] = null
res.status(304) res.status(304)
oldSend.apply(res, args) oldSend.apply(res, args)