wakeflow-logger

1.0.11 • Public • Published

Intro

We use this repo to send logs to the Google Cloud Platform

Installation

npm i wakeflow-logger

Usage

import { Logger } from 'wakeflow-logger'

const logger = new Logger()

logger.info('this is info')
logger.warn('this is a warning')
logger.error('this is an error')
logger.error(new Error('hello error'))

try{
  something()
}catch(err){
  logger.error(err)
}

logger.info('you can also add a json payload',{payload:"this is a json payload"})
logger.info({payload:"or send only a json payload"})

Development mode

If you are working on your local machine, logs are sent to console.log

Only if NODE_ENV=production do logs get sent to GCP

Viewing logs

To view your logs go to: https://console.cloud.google.com/logs

and enter the query labels.wakeflow="wakeflow"

Make sure you're looking at the correct GCP project.


Wakeflow Logo

👨‍💻 Visit us on www.wakeflow.io

💬 Chat with us on WhatsApp or our live chat

✉️ Email us

Package Sidebar

Install

npm i wakeflow-logger

Weekly Downloads

2

Version

1.0.11

License

ISC

Unpacked Size

6.4 kB

Total Files

6

Last publish

Collaborators

  • andi-wakeflow