feat: add pino logger
This commit is contained in:
parent
c12dc1a6c7
commit
3015f13e0d
10 changed files with 195 additions and 47 deletions
|
|
@ -1,5 +1,6 @@
|
|||
const app = require('./src/app')
|
||||
const { baseWebhookURL } = require('./src/config')
|
||||
const { logger } = require('./src/logger')
|
||||
require('dotenv').config()
|
||||
|
||||
// Start the server
|
||||
|
|
@ -7,12 +8,12 @@ const port = process.env.PORT || 3000
|
|||
|
||||
// Check if BASE_WEBHOOK_URL environment variable is available
|
||||
if (!baseWebhookURL) {
|
||||
console.error('BASE_WEBHOOK_URL environment variable is not set. Exiting...')
|
||||
logger.error('BASE_WEBHOOK_URL environment variable is not set. Exiting...')
|
||||
process.exit(1) // Terminate the application with an error code
|
||||
}
|
||||
|
||||
app.listen(port, () => {
|
||||
console.log(`Server running on port ${port}`)
|
||||
logger.info(`Server running on port ${port}`)
|
||||
})
|
||||
|
||||
// puppeteer uses subscriptions to SIGINT, SIGTERM, and SIGHUP to know when to close browser instances
|
||||
|
|
|
|||
Loading…
Reference in a new issue