Skip to content

wakeflow/wakeflow-logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •