chore: use logger for all important logs
This commit is contained in:
parent
6f73606cfb
commit
21bdf5f60a
16 changed files with 51 additions and 39 deletions
|
|
@ -14,6 +14,7 @@ const _ = require('lodash/fp')
|
|||
const { asyncLocalStorage, defaultStore } = require('../async-storage')
|
||||
const options = require('../options')
|
||||
const users = require('../users')
|
||||
const logger = require('../logger')
|
||||
|
||||
const session = require('./middlewares/session')
|
||||
const { AuthDirective } = require('./graphql/directives')
|
||||
|
|
@ -25,7 +26,7 @@ const frontCameraBasedir = _.get('frontCameraDir', options)
|
|||
|
||||
const hostname = options.hostname
|
||||
if (!hostname) {
|
||||
console.error('Error: no hostname specified.')
|
||||
logger.error('no hostname specified.')
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
|
|
@ -48,7 +49,7 @@ const apolloServer = new ApolloServer({
|
|||
playground: false,
|
||||
introspection: false,
|
||||
formatError: error => {
|
||||
console.log(error)
|
||||
logger.error(error)
|
||||
return error
|
||||
},
|
||||
context: async ({ req, res }) => {
|
||||
|
|
@ -104,7 +105,7 @@ function run () {
|
|||
const serverLog = `lamassu-admin-server listening on port ${serverPort}`
|
||||
|
||||
const webServer = https.createServer(certOptions, app)
|
||||
webServer.listen(serverPort, () => console.log(serverLog))
|
||||
webServer.listen(serverPort, () => logger.info(serverLog))
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue